From e3fa454f30bced1f9342e8a3b41951dbe9eebc03 Mon Sep 17 00:00:00 2001 From: Junrou Nishida Date: Thu, 12 May 2022 14:01:52 +0900 Subject: [PATCH] fix(plugin): check if the target local asset is missing (#562) --- .../Scripts/Unity/ResourceManager/LocalResourceManager.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/ResourceManager/LocalResourceManager.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/ResourceManager/LocalResourceManager.cs index d23a8c7b2..2b1e20fb0 100644 --- a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/ResourceManager/LocalResourceManager.cs +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/ResourceManager/LocalResourceManager.cs @@ -52,6 +52,11 @@ public override IEnumerator PrepareAssetAsync(string name, string uniqueKey, boo var assetPath = GetAssetPathFor(name); var asset = AssetDatabase.LoadAssetAtPath(assetPath); + if (asset == null) + { + throw new FileNotFoundException($"{assetPath} is not found. Check if {name} is included in the package"); + } + Logger.LogVerbose(_TAG, $"Writing {name} data to {destFilePath}..."); if (!Directory.Exists(_CachePathRoot)) {