FIXED:<class 'td.Poly'> returned a result with an error set

x64 win10 2019.17550

One of the weirder bugs I’ve encountered using a script SOP-

This errors, sometimes crashing TD:

[code]### THIS IS BROKEN !!!

def onCook(scriptOp):

trg = op('f1').prims[0]

resultList = []

if trg != None:
	
	for i, vertex in enumerate(trg):
		resultList += [ [vertex.point.x,vertex.point.y] ]

return[/code]

and this works:

[code]### works for some reason

def onCook(scriptOp):

trg = op('f1').prims[0]

resultList = []

#assert trg!=None,'prim cannot be none'

for i, vertex in enumerate(trg):
	resultList += [ [vertex.point.x,vertex.point.y] ]

return[/code]

attached a simplified file as well.
CS_chaser_Fix.29.toe (4.33 KB)

This should be fixed in 2019.18300 which is now posted.