forked from rosebudai/OpenRCT2-Web
Fix null pointer dereference when cancelling an RCT1 location dialog on Mac OS X.
To reproduce, run openrct2 on OSX, go to the options dialog, then to the bottom of the misc tab, select an RCT1 location. Then, cancel that dialog. This would trigger a null pointer dereference by returning std::string(nullptr).
This commit is contained in:
1 parent
1aed331928
commit
553e16144b
1 file changed
+3
-3
@@ -118,14 +118,14 @@ namespace OpenRCT2 { namespace Ui
|
||||
panel.canChooseFiles = false;
|
||||
panel.canChooseDirectories = true;
|
||||
panel.allowsMultipleSelection = false;
|
||||
utf8 *url = NULL;
|
||||
if ([panel runModal] == NSFileHandlingPanelOKButton)
|
||||
{
|
||||
NSString *selectedPath = panel.URL.path;
|
||||
const char *path = selectedPath.UTF8String;
|
||||
url = _strdup(path);
|
||||
return path;
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
return url;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user