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