added catch for NullPointerException
Merge pull request #1073 from Catrobat/cat-930

[CAT-930] added catch for NullPointerException
CAT-930 #close