Skip to content

Commit

Permalink
fix(animation-mixer): handle null property without crashing
Browse files Browse the repository at this point in the history
  • Loading branch information
mwfarb committed Feb 21, 2023
1 parent e7a412f commit 906f4b9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Runtime/ArenaUnity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -820,15 +820,15 @@ internal static void ToArenaAnimationMixer(GameObject gobj, ref JObject jData)
}
internal static void ToUnityAnimationMixer(dynamic data, JObject jData, ref GameObject gobj)
{
ArenaAnimationMixer am = gobj.GetComponent<ArenaAnimationMixer>();
if (am == null)
am = gobj.AddComponent<ArenaAnimationMixer>();
JToken amObj = jData.SelectToken("animation-mixer");
if (amObj != null)
if (amObj != null && amObj.HasValues)
{
ArenaAnimationMixer am = gobj.GetComponent<ArenaAnimationMixer>();
if (am == null)
am = gobj.AddComponent<ArenaAnimationMixer>();
am.json = ArenaAnimationMixerJson.CreateFromJSON(JsonConvert.SerializeObject(amObj), amObj);
am.apply = true;
}
am.apply = true;
}
}
}

0 comments on commit 906f4b9

Please sign in to comment.