Skip to content

Commit 4ddf21f

Browse files
committed
Switches: use default white colour if LightControls is not valid
1 parent e3127e5 commit 4ddf21f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/colordimmerdata.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,15 @@ void ColorDimmerData::reload()
156156
return;
157157
}
158158

159-
const QVariantList colorData = m_colorDataItem->getValue().toList();
160159
QColor color;
161160
qreal white = 0;
162161
qreal colorTemperature = 0;
163-
::getStorageColorData(colorData, &color, &white, &colorTemperature);
162+
const QVariantList colorData = m_colorDataItem->getValue().toList();
163+
if (colorData.isEmpty()) {
164+
color = QColor::fromHsv(0, 0, 0);
165+
} else {
166+
::getStorageColorData(colorData, &color, &white, &colorTemperature);
167+
}
164168

165169
setColor(color);
166170
setWhite(white);

0 commit comments

Comments
 (0)