Fix crash in editor