Fix bug - potentially invalid pointer.

Removing a file without an associated editor would cause the IDE to crash.