music: check parent and siblings for null
This commit is contained in:
@@ -411,13 +411,21 @@ public class MusicPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
{
|
{
|
||||||
Widget handle = slider.getHandle();
|
Widget handle = slider.getHandle();
|
||||||
Widget[] siblings = handle.getParent().getChildren();
|
Widget parent = handle.getParent();
|
||||||
if (siblings.length < handle.getIndex() || siblings[handle.getIndex()] != handle)
|
if (parent == null)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
siblings[slider.getTrack().getIndex()] = null;
|
else
|
||||||
siblings[handle.getIndex()] = null;
|
{
|
||||||
|
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();
|
Object[] init = icon.getOnLoadListener();
|
||||||
@@ -444,11 +452,19 @@ public class MusicPlugin extends Plugin
|
|||||||
Widget handle = slider.getHandle();
|
Widget handle = slider.getHandle();
|
||||||
if (handle != null)
|
if (handle != null)
|
||||||
{
|
{
|
||||||
Widget[] siblings = handle.getParent().getChildren();
|
Widget parent = handle.getParent();
|
||||||
if (siblings.length < handle.getIndex() || siblings[handle.getIndex()] != handle)
|
if (parent == null)
|
||||||
{
|
{
|
||||||
handle = null;
|
handle = null;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Widget[] siblings = parent.getChildren();
|
||||||
|
if (siblings == null || handle.getIndex() >= siblings.length || siblings[handle.getIndex()] != handle)
|
||||||
|
{
|
||||||
|
handle = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (handle == null)
|
if (handle == null)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user