music: Fix some NPEs

This commit is contained in:
BossHuso
2021-02-18 14:55:09 -08:00
committed by Adam
parent 0cec0039ca
commit 8535bfc0bf

View File

@@ -557,11 +557,16 @@ public class MusicPlugin extends Plugin
return; return;
} }
for (Widget w : track.getChildren()) Widget[] trackChildren = track.getChildren();
if (trackChildren != null)
{ {
if (w != null) for (Widget w : trackChildren)
{ {
w.setAction(0, null); if (w != null)
{
w.setAction(0, null);
}
} }
} }
@@ -588,7 +593,11 @@ public class MusicPlugin extends Plugin
public void shutDown() public void shutDown()
{ {
super.shutDown(); super.shutDown();
handle.setSpriteId(SpriteID.SETTINGS_SLIDER_HANDLE_BLUE);
if (this.handle != null)
{
handle.setSpriteId(SpriteID.SETTINGS_SLIDER_HANDLE_BLUE);
}
this.icon.setOnOpListener((Object[]) null); this.icon.setOnOpListener((Object[]) null);