Properly null-check chat performance widgets

Closes #6575

Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
This commit is contained in:
Tomas Slusny
2018-11-19 16:51:21 +01:00
parent 3286594d6b
commit caa1eadc3d

View File

@@ -61,9 +61,16 @@ public class ChatboxPerformancePlugin extends Plugin
{
return true;
}
Widget[] widgets = widget.getChildren();
return widgets.length > 0 && widgets[widgets.length - 1].getOpacity() < 254;
if (widgets != null && widgets.length > 0)
{
Widget last = widgets[widgets.length - 1];
return last != null && last.getOpacity() < 254;
}
return false;
}
private void fixChatbox()