Fix crash when deleting unsaved entries