Ensure device view is initialized if there are no LEDs to avoid accessing out of bounds

This commit is contained in:
Adam Honse
2026-04-16 16:12:04 -05:00
parent 3f32817272
commit 388557e5f9

View File

@@ -736,7 +736,7 @@ void DeviceView::paintEvent(QPaintEvent* /* event */)
/*-----------------------------------------------------*\
| If controller has resized, reinitialize local data |
\*-----------------------------------------------------*/
if(controller->leds.size() != led_pos.size())
if((controller->zones.size() != zone_pos.size()) || (controller->leds.size() != led_pos.size()))
{
InitDeviceView();
}