File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
Assets/FbxExporters/Editor Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -283,22 +283,28 @@ public static string[] DCCVendorLocations {
283
283
if ( ! string . IsNullOrEmpty ( location ) )
284
284
{
285
285
//If we are on Windows, we need only go up one location to get to the "Autodesk" folder.
286
- var possibleLocation = Directory . GetParent ( location ) . ToString ( ) ;
286
+ string possibleLocation = location ;
287
+ if ( Directory . GetParent ( location ) != null )
288
+ {
289
+ possibleLocation = Directory . GetParent ( location ) . ToString ( ) ;
290
+ }
287
291
288
292
if ( Application . platform == RuntimePlatform . OSXEditor )
289
293
{
290
294
int appIndex = location . IndexOf ( "Maya.app" ) ;
291
295
292
296
//If we found 'Maya.app' in the location string, we're going to trim it and everything after it out
293
297
//This way our possibleLocation will be more uniform between windows and mac
294
- if ( appIndex != - 1 )
298
+ if ( appIndex >= 0 &&
299
+ Directory . GetParent ( location ) != null &&
300
+ Directory . GetParent ( Directory . GetParent ( location ) . ToString ( ) ) != null )
295
301
{
296
302
possibleLocation = location . Substring ( 0 , ( appIndex - 1 ) ) ;
297
- possibleLocation = Directory . GetParent ( Directory . GetParent ( location ) . ToString ( ) ) . ToString ( ) ;
303
+ possibleLocation = Directory . GetParent ( Directory . GetParent ( possibleLocation ) . ToString ( ) ) . ToString ( ) ;
298
304
}
299
305
}
300
306
301
- if ( Directory . Exists ( possibleLocation ) )
307
+ if ( ! string . IsNullOrEmpty ( possibleLocation ) && Directory . Exists ( possibleLocation ) )
302
308
{
303
309
locationsList . Add ( possibleLocation . ToString ( ) ) ;
304
310
}
You can’t perform that action at this time.
0 commit comments