music: check parent and siblings for null

This commit is contained in:
Max Weber
2019-10-24 13:29:05 -06:00
committed by Adam
parent a2166f1215
commit 66e7acd86f

View File

@@ -411,13 +411,21 @@ public class MusicPlugin extends Plugin
{
{
Widget handle = slider.getHandle();
Widget[] siblings = handle.getParent().getChildren();
if (siblings.length < handle.getIndex() || siblings[handle.getIndex()] != handle)
Widget parent = handle.getParent();
if (parent == null)
{
continue;
}
siblings[slider.getTrack().getIndex()] = null;
siblings[handle.getIndex()] = null;
else
{
Widget[] siblings = parent.getChildren();
if (siblings == null || handle.getIndex() >= siblings.length || siblings[handle.getIndex()] != handle)
{
continue;
}
siblings[slider.getTrack().getIndex()] = null;
siblings[handle.getIndex()] = null;
}
}
Object[] init = icon.getOnLoadListener();
@@ -444,11 +452,19 @@ public class MusicPlugin extends Plugin
Widget handle = slider.getHandle();
if (handle != null)
{
Widget[] siblings = handle.getParent().getChildren();
if (siblings.length < handle.getIndex() || siblings[handle.getIndex()] != handle)
Widget parent = handle.getParent();
if (parent == null)
{
handle = null;
}
else
{
Widget[] siblings = parent.getChildren();
if (siblings == null || handle.getIndex() >= siblings.length || siblings[handle.getIndex()] != handle)
{
handle = null;
}
}
}
if (handle == null)
{