diff --git a/UndertaleModTool/Controls/UndertaleRoomRenderer.xaml.cs b/UndertaleModTool/Controls/UndertaleRoomRenderer.xaml.cs index 624bcf5a2..60ae220f2 100644 --- a/UndertaleModTool/Controls/UndertaleRoomRenderer.xaml.cs +++ b/UndertaleModTool/Controls/UndertaleRoomRenderer.xaml.cs @@ -64,8 +64,12 @@ private void RoomRenderer_DataContextChanged(object sender, DependencyPropertyCh { if (layer.LayerType == LayerType.Assets) { - var particleSystems = layer.AssetsData.ParticleSystems.Select(x => x.ParticleSystem); - ParticleSystemRectConverter.Initialize(particleSystems); + if (layer.AssetsData.ParticleSystems is not null) + { + var particleSystems = layer.AssetsData.ParticleSystems.Select(x => x.ParticleSystem); + ParticleSystemRectConverter.Initialize(particleSystems); + } + } } } diff --git a/UndertaleModTool/Editors/UndertaleRoomEditor.xaml.cs b/UndertaleModTool/Editors/UndertaleRoomEditor.xaml.cs index bbf9aaaf4..6a3cd5c53 100644 --- a/UndertaleModTool/Editors/UndertaleRoomEditor.xaml.cs +++ b/UndertaleModTool/Editors/UndertaleRoomEditor.xaml.cs @@ -2691,7 +2691,7 @@ public object Convert(object value, Type targetType, object parameter, CultureIn if (parameter is not string mode) return 0; - if (!partSystemsDict.TryGetValue(partSys, out Rect sysRect)) + if (partSystemsDict is not null && !partSystemsDict.TryGetValue(partSys, out Rect sysRect)) sysRect = AddNewSystem(partSys); return mode switch