adds null check

Should fix #229 and #221

Btw I hate modders who make ItemStacks of null Items