The author of the code below calls a function without checking whether the arguments are correct.
; ObjectReference[] ItemArray = ...
Int i = 0
While i < ItemArray.Length
ObjectReference kItem = ItemArray[i]
kItem.Activate(DummyRef)
i += 1
EndWhile
If an object or argument becomes None
prior to the function call, Papyrus will abort the function call and log the following error:
error: Cannot call
Activate()
on aNone
object, aborting function call
Check the variable or variables for None
before the function call.
; ObjectReference[] ItemArray = ...
Int i = 0
While i < ItemArray.Length
ObjectReference kItem = ItemArray[i]
If kItem && DummyRef
kItem.Activate(DummyRef)
EndIf
i += 1
EndWhile