From 8f6e6d689aede0ff7aa37a25623310d968057325 Mon Sep 17 00:00:00 2001 From: ousttrue Date: Fri, 15 Apr 2022 17:42:42 +0900 Subject: [PATCH] catch migration exception --- Assets/VRM10/Runtime/IO/Vrm10Data.cs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/Assets/VRM10/Runtime/IO/Vrm10Data.cs b/Assets/VRM10/Runtime/IO/Vrm10Data.cs index cf4c9069e..d9d8b7853 100644 --- a/Assets/VRM10/Runtime/IO/Vrm10Data.cs +++ b/Assets/VRM10/Runtime/IO/Vrm10Data.cs @@ -65,11 +65,21 @@ namespace UniVRM10 } // try migrate... - var migrated = MigrationVrm.Migrate(data); - if (migrated == null) + byte[] migrated = null; + try + { + migrated = MigrationVrm.Migrate(data); + if (migrated == null) + { + vrm1Data = default; + migration = new MigrationData("Found vrm0. But fail to migrate", oldMeta); + return null; + } + } + catch (Exception ex) { vrm1Data = default; - migration = new MigrationData("Found vrm0. But fail to migrate", oldMeta); + migration = new MigrationData(ex.Message, oldMeta); return null; }