Followup 1bdef80: Fix crash when layer not in edit mode