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) {