Fixed null pointer error for player inventory