Index: networkcontrol.cpp
===================================================================
--- networkcontrol.cpp	(revision 10187)
+++ networkcontrol.cpp	(working copy)
@@ -328,7 +329,11 @@
         return QString("ERROR: See 'help %1' for usage information")
                        .arg(tokens[0]);
 
+    if(!gContext) return QString( "ERROR: Application has no context." );
+    if(!gContext->GetMainWindow()) return QString( "ERROR: Application has no main window." );
+    if(!gContext->GetMainWindow()->currentWidget()) return QString( "ERROR: Application has no current widget." );
     QWidget *widget = gContext->GetMainWindow()->currentWidget()->focusWidget();
+    if(!widget) return QString( "ERROR: Application has no focussed widget." );
     unsigned int curToken = 1;
     while (curToken < tokens.size())
     {
