Skip to content

Commit 531e8b8

Browse files
author
AJubrey
committed
[FIXED] bug where if we found a duplicate of what we wanted to add, we were continue-ing instead of break-ing
[REMOVED] a duplicate check for duplicates [ADDED] comment clarifying how we take care of the strings
1 parent a18cf92 commit 531e8b8

File tree

1 file changed

+6
-16
lines changed

1 file changed

+6
-16
lines changed

Assets/FbxExporters/Editor/FbxExportSettings.cs

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -288,16 +288,19 @@ public static string[] DCCVendorLocations {
288288
//If we are on Windows, we need only go up one location to get to the "Autodesk" folder.
289289
if (Directory.GetParent(location) != null)
290290
{
291+
//'Directory.GetParent()' will take care of any double backslashes the user may have added
291292
possibleLocation = Directory.GetParent(location).ToString();
292293

293294
//Make sure the user defined path is not included in the default paths
294295
for (int i = 0; i < WindowsDefaultLocations.Count; i++)
295296
{
296297
//we don't want a minute difference in slashes or capitalization to throw off our check
297-
if (WindowsDefaultLocations[i].Replace("\\", "/").ToLower().Equals(possibleLocation.Replace("\\", "/").ToLower()))
298+
if (WindowsDefaultLocations[i] != null &&
299+
possibleLocation != null &&
300+
WindowsDefaultLocations[i].Replace("\\", "/").ToLower().Equals(possibleLocation.Replace("\\", "/").ToLower()))
298301
{
299302
possibleLocation = null;
300-
continue;
303+
break;
301304
}
302305
}
303306
}
@@ -338,20 +341,7 @@ public static string[] DCCVendorLocations {
338341

339342
if (!string.IsNullOrEmpty(possibleLocation) && Directory.Exists(possibleLocation))
340343
{
341-
bool foundDuplicate = false;
342-
for (int i = 0; i < locationsList.Count; i++)
343-
{
344-
if (locationsList[i].Replace("\\", "/").ToLower().Equals(possibleLocation.Replace("\\", "/").ToLower()))
345-
{
346-
foundDuplicate = true;
347-
break;
348-
}
349-
}
350-
351-
if (!foundDuplicate)
352-
{
353-
locationsList.Add(possibleLocation.ToString());
354-
}
344+
locationsList.Add(possibleLocation.ToString());
355345
}
356346
}
357347

0 commit comments

Comments
 (0)