Fixing potential issue that fails to create AssetReference when asset type of asset on given path is null.
This commit is contained in:
Родитель
1dcc8f8bef
Коммит
8cbe5aa145
|
@ -105,8 +105,9 @@ namespace UnityEngine.AssetGraph {
|
|||
}
|
||||
}
|
||||
|
||||
foreach (string str in importedAssets) {
|
||||
AssetReferenceDatabase.GetReference (str).InvalidateTypeCache();
|
||||
foreach (string str in importedAssets)
|
||||
{
|
||||
AssetReferenceDatabase.GetReference(str)?.InvalidateTypeCache();
|
||||
}
|
||||
|
||||
foreach (string str in deletedAssets)
|
||||
|
|
|
@ -133,7 +133,9 @@ namespace UnityEngine.AssetGraph {
|
|||
db.m_dictionary.Add(relativePath, r);
|
||||
AssetReferenceDatabase.SetDBDirty();
|
||||
return r;
|
||||
} catch(AssetReferenceException ) {
|
||||
} catch(AssetReferenceException e) {
|
||||
LogUtility.Logger.LogWarning (LogUtility.kTag,
|
||||
$"AssetReference could not be created: Asset:{e.importFrom} Message:{e.Message}");
|
||||
// if give asset is invalid, return null
|
||||
return null;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче