Fixed: check for skip before trying to open file.

This commit is contained in:
arookas 2015-12-10 17:18:28 -05:00
parent f0371d345e
commit 85d85695e2

View file

@ -68,6 +68,11 @@ namespace arookas
}
}
}
// make sure the file has not been imported yet
if (imports.Any(i => i.Name == fullPath))
{
return sunImportResult.Skipped;
}
// open the file
try
{
@ -77,11 +82,6 @@ namespace arookas
{
return sunImportResult.FailedToLoad;
}
// make sure the file has not been imported yet
if (imports.Any(i => i.Name == fullPath))
{
return sunImportResult.Skipped;
}
imports.Add(file);
return sunImportResult.Loaded;
}