@@ -288,16 +288,19 @@ public static string[] DCCVendorLocations {
288
288
//If we are on Windows, we need only go up one location to get to the "Autodesk" folder.
289
289
if ( Directory . GetParent ( location ) != null )
290
290
{
291
+ //'Directory.GetParent()' will take care of any double backslashes the user may have added
291
292
possibleLocation = Directory . GetParent ( location ) . ToString ( ) ;
292
293
293
294
//Make sure the user defined path is not included in the default paths
294
295
for ( int i = 0 ; i < WindowsDefaultLocations . Count ; i ++ )
295
296
{
296
297
//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 ( ) ) )
298
301
{
299
302
possibleLocation = null ;
300
- continue ;
303
+ break ;
301
304
}
302
305
}
303
306
}
@@ -338,20 +341,7 @@ public static string[] DCCVendorLocations {
338
341
339
342
if ( ! string . IsNullOrEmpty ( possibleLocation ) && Directory . Exists ( possibleLocation ) )
340
343
{
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 ( ) ) ;
355
345
}
356
346
}
357
347
0 commit comments