XCodeHelper: fix null exception when trying to get the ID or name of the selected iOS simulator

Ideally, it shouldn't return null, but if it does, fail gracefully
This commit is contained in:
Josh Tynjala
2023-04-11 15:50:53 -07:00
parent e753c5c933
commit 2e19898c28

View File

@@ -101,12 +101,22 @@ class XCodeHelper
public static function getSimulatorID(project:HXProject):String
{
return getSelectedSimulator(project).id;
var simulator = getSelectedSimulator(project);
if (simulator == null)
{
return null;
}
return simulator.id;
}
public static function getSimulatorName(project:HXProject):String
{
return getSelectedSimulator(project).name;
var simulator = getSelectedSimulator(project);
if (simulator == null)
{
return null;
}
return simulator.name;
}
private static function getSimulators():String