Fix crash when resizing editor