summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSonicadvance1 <sonicadvance1@gmail.com>2008-12-09 23:19:44 +0000
committerSonicadvance1 <sonicadvance1@gmail.com>2008-12-09 23:19:44 +0000
commit05d2e470bfcf99cd8b553fc9370ea606a71ef585 (patch)
treeaf3029c4b91d500d2148a53b36465c4ccd90cbf8
parent0e47a7986dc5cea404f0e7bc886848c6addafee4 (diff)
Made opening the ISO file more safe, so it doesn't seg fault when it can't find the filetype from extension and etc.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1469 8ced0084-cf51-0410-be5f-012b33b47a6e
-rw-r--r--Source/Core/DolphinWX/Src/ISOProperties.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/Source/Core/DolphinWX/Src/ISOProperties.cpp b/Source/Core/DolphinWX/Src/ISOProperties.cpp
index 96f1982d37..dd4298929e 100644
--- a/Source/Core/DolphinWX/Src/ISOProperties.cpp
+++ b/Source/Core/DolphinWX/Src/ISOProperties.cpp
@@ -585,7 +585,18 @@ void CISOProperties::OnEditConfig(wxCommandEvent& WXUNUSED (event))
SaveGameConfig();
wxFileType* filetype = wxTheMimeTypesManager->GetFileTypeFromExtension(_("ini"));
- wxExecute(filetype->GetOpenCommand(wxString::FromAscii(GameIniFile.c_str())), wxEXEC_SYNC);
+ if(filetype == NULL)
+ {
+ PanicAlert("Filetype 'ini' is unknown! Will not open!");
+ return;
+ }
+ wxString OpenCommand;
+ OpenCommand = filetype->GetOpenCommand(wxString::FromAscii(GameIniFile.c_str()));
+ if(OpenCommand.IsEmpty())
+ PanicAlert("Couldn't find open command for extension 'ini'!");
+ else
+ if(wxExecute(OpenCommand, wxEXEC_SYNC) == -1)
+ PanicAlert("wxExecute returned -1 on application run!");
GameIni.Load(GameIniFile.c_str());
LoadGameConfig();