Permalink
Browse files

MythUIFileBrowser: Fix a segfault if the 'back' button is missing.

The 'back' button is optional in that dialog so make sure we have one before
trying to update it.
  • Loading branch information...
Paul Harrison
Paul Harrison committed Mar 16, 2011
1 parent 58c1263 commit f1ab9ed9b5af39067e6cdee464ee3f7e94999882
Showing with 9 additions and 3 deletions.
  1. +9 −3 mythtv/libs/libmythui/mythuifilebrowser.cpp
@@ -499,10 +499,14 @@ void MythUIFileBrowser::updateRemoteFileList()
item->SetText(QString("0"), "filesize");
item->SetText(m_parentDir, "fullpath");
item->DisplayState(type, "nodetype");
- m_backButton->SetEnabled(true);
+ if (m_backButton)
+ m_backButton->SetEnabled(true);
}
else
- m_backButton->SetEnabled(false);
+ {
+ if (m_backButton)
+ m_backButton->SetEnabled(false);
+ }
QStringList::const_iterator it = slist.begin();
while (it != slist.end())
@@ -667,7 +671,9 @@ void MythUIFileBrowser::updateLocalFileList()
}
}
- m_backButton->SetEnabled(showBackButton);
+ if (m_backButton)
+ m_backButton->SetEnabled(showBackButton);
+
m_locationEdit->SetText(m_subDirectory);
}

0 comments on commit f1ab9ed

Please sign in to comment.