Added check that mouse target is not null when updating resource gui.