fix crash when clicking Code while having a playable object selected
merge of editor.cpp changes