Core/Script:

Added missing NULL pointer check
Close #10863