Ticket #1951: mythtv-networkcontrol-fix-20060613

File mythtv-networkcontrol-fix-20060613, 833 bytes (added by navahogunleg@…, 18 years ago)
Line 
1Index: networkcontrol.cpp
2===================================================================
3--- networkcontrol.cpp  (revision 10187)
4+++ networkcontrol.cpp  (working copy)
5@@ -328,7 +329,11 @@
6         return QString("ERROR: See 'help %1' for usage information")
7                        .arg(tokens[0]);
8 
9+    if(!gContext) return QString( "ERROR: Application has no context." );
10+    if(!gContext->GetMainWindow()) return QString( "ERROR: Application has no main window." );
11+    if(!gContext->GetMainWindow()->currentWidget()) return QString( "ERROR: Application has no current widget." );
12     QWidget *widget = gContext->GetMainWindow()->currentWidget()->focusWidget();
13+    if(!widget) return QString( "ERROR: Application has no focussed widget." );
14     unsigned int curToken = 1;
15     while (curToken < tokens.size())
16     {