Skip to content

Commit 25d3f41

Browse files
author
AJubrey
committed
[CHANGED] check of appindex to actually protect us from making an invalid substring
[FIXED] a comment
1 parent 6dbd8e5 commit 25d3f41

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

Assets/FbxExporters/Editor/FbxExportSettings.cs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -289,16 +289,19 @@ public static string[] DCCVendorLocations {
289289

290290
//If we found 'Maya.app' in the location string, we're going to trim it and everything after it out.
291291
//This way our possibleLocation will be more uniform between windows and mac.
292+
293+
//make sure we found "maya.app."
294+
if (appIndex >= 0)
295+
{
296+
//get everything up until 'maya.app'
297+
string subLocation = location.Substring(0, (appIndex - 1));
292298

293-
//get everything up until 'maya.exe'
294-
string subLocation = location.Substring(0, (appIndex - 1));
295-
296-
var parentDirectory = Directory.GetParent(subLocation);
299+
var parentDirectory = Directory.GetParent(subLocation);
297300

298-
if (appIndex >= 0 && parentDirectory != null)
299-
{
300-
possibleLocation = parentDirectory.ToString();
301-
Debug.Log(possibleLocation.ToString());
301+
if (parentDirectory != null)
302+
{
303+
possibleLocation = parentDirectory.ToString();
304+
}
302305
}
303306
}
304307

0 commit comments

Comments
 (0)