Better null check of script results