music: correctly recreate volume widgets after relogs

This commit is contained in:
Max Weber
2020-03-09 01:28:29 -06:00
parent a34d9d30d6
commit 480a5ab921

View File

@@ -452,7 +452,9 @@ public class MusicPlugin extends Plugin
for (MusicSlider slider : MusicSlider.values()) for (MusicSlider slider : MusicSlider.values())
{ {
Widget icon = client.getWidget(slider.getWidgetID()); Widget icon = client.getWidget(slider.getWidgetID());
if (icon == null) // VolumeChanged can trigger us before the sliders interface is fully valid, so
// we check if the width is set before we copy it to all of our widgets
if (icon == null || icon.getWidth() == 0)
{ {
return; return;
} }