Fixed an error while event throws false or non array
Updated check if the event output is an array
Fixed an error while element not found event returns false or non array

* origin/pr/11178:
  Updated check if the event output is an array
  Fixed an error while event throws false or non array