From cf4c4e6bbaddfefe5929b1d8f153e026ad74f6b9 Mon Sep 17 00:00:00 2001 From: Asval Date: Tue, 11 Aug 2026 18:21:35 +0200 Subject: [PATCH] fix --- FModel/Views/Snooper/Models/StaticModel.cs | 4 ++-- FModel/Views/Snooper/Renderer.cs | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) 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;