fix logic (and possible segfault if !editor)
add some assert() messages.

as hints clang static analyzer "Called C++ object pointer is null"
NULL pointer dereference?
prevent segfault if in/out property is missing