Fix broken command line rendering. 

Should always check that editor windows exist before using them. Otherwise there are segmentation faults and unhappy users...