Fixed NPE when clicking outside of the inventory window