Skip to content

Commit

Permalink
Merge pull request #1543 from Miepee/some-issue
Browse files Browse the repository at this point in the history
Fix NRE when trying to export rooms as PNG
  • Loading branch information
colinator27 authored Dec 21, 2023
2 parents c8d233b + 2eff692 commit 6324f2a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions UndertaleModTool/Controls/UndertaleRoomRenderer.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

}
}
}
Expand Down
2 changes: 1 addition & 1 deletion UndertaleModTool/Editors/UndertaleRoomEditor.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6324f2a

Please sign in to comment.