Fixed crash upon clicking in the level editor without a layer