From 777a3caea9b88abb42d3b73b36558f63690b911d Mon Sep 17 00:00:00 2001 From: Favo Yang Date: Sat, 15 May 2021 22:47:54 +0800 Subject: [PATCH] fix: null reference error since r9682904 --- Editor/AddressableImporter.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Editor/AddressableImporter.cs b/Editor/AddressableImporter.cs index d3b5b06..6508b0f 100644 --- a/Editor/AddressableImporter.cs +++ b/Editor/AddressableImporter.cs @@ -44,9 +44,9 @@ static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAsse // Apply import rules. var prefabStage = PrefabStageUtility.GetCurrentPrefabStage(); #if UNITY_2020_1_OR_NEWER - string prefabAssetPath = prefabStage.assetPath; + string prefabAssetPath = prefabStage != null ? prefabStage.assetPath : null; #else - string prefabAssetPath = prefabStage.prefabAssetPath; + string prefabAssetPath = prefabStage != null ? prefabStage.prefabAssetPath : null; #endif foreach (var importedAsset in importedAssets) {