Fix crashes when itemstack is nil