mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
Palette: Protects itself against initializing from Rules with no theme
This commit is contained in:
parent
117587e1c5
commit
bf7b48690b
1 changed files with 7 additions and 3 deletions
|
@ -51,9 +51,13 @@ Palette::Palette ()
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
void Palette::initialize (const Rules& rules)
|
void Palette::initialize (const Rules& rules)
|
||||||
{
|
{
|
||||||
_colors.clear ();
|
auto themeColors = rules.all ("theme.palette.color");
|
||||||
for (auto& entry : rules.all ("theme.palette.color"))
|
if (themeColors.size ())
|
||||||
_colors.push_back (Color (rules.get (entry)));
|
{
|
||||||
|
_colors.clear ();
|
||||||
|
for (auto& entry : themeColors)
|
||||||
|
_colors.push_back (Color (rules.get (entry)));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue