diff --git a/FModel/Views/Snooper/Models/StaticModel.cs b/FModel/Views/Snooper/Models/StaticModel.cs index dcb654b4..e32e655c 100644 --- a/FModel/Views/Snooper/Models/StaticModel.cs +++ b/FModel/Views/Snooper/Models/StaticModel.cs @@ -136,9 +136,9 @@ public class StaticModel : UModel } Box = staticMesh.Bounds * Constants.SCALE_DOWN_RATIO; - for (int i = 0; i < export.Sockets.Length; i++) + foreach (var s in export.Sockets ?? []) { - if (export.Sockets[i].Load() is not { } socket) continue; + if (s.Load() is not { } socket) continue; Sockets.Add(new Socket(socket)); } } diff --git a/FModel/Views/Snooper/Renderer.cs b/FModel/Views/Snooper/Renderer.cs index 3102ca5f..9bd26581 100644 --- a/FModel/Views/Snooper/Renderer.cs +++ b/FModel/Views/Snooper/Renderer.cs @@ -160,9 +160,10 @@ public class Renderer : IDisposable model.Skeleton.Animate(animSet); Options.AddAnimation(animation); - foreach (var notifyEvent in animBase.Notifies) + foreach (var notifyEvent in animBase.Notifies ?? []) { - if (!notifyEvent.NotifyStateClass.TryLoad(out UObject notifyClass) || + if (notifyEvent.NotifyStateClass is null || + !notifyEvent.NotifyStateClass.TryLoad(out UObject notifyClass) || !notifyClass.TryGetValue(out UObject export, "SkeletalMeshProp", "StaticMeshProp", "Mesh", "SkeletalMeshTemplate")) continue;