Old Code, Do I still need to make these checks?
Posted: Tue Oct 12, 2021 12:45 pm
Hi! It has been a long time, since I was active here. So I was reading through some old code and I was wondering if these try-catch cases are still necessary to prevent crashes and is this still the "correct" way to do this?
Syntax: Select all
@EntityPreHook(EntityCondition.equals_entity_classname('trigger_multiple'), 'start_touch')
def start_touch_func(args):
try:
obj1 = make_object(BaseEntity, args[0])
except:
return
try:
ob2 = make_object(BaseEntity, args[1])
except:
return
# do more here...