Skip to content

Commit

Permalink
do not access ia7_config.state_colors if it was not defined in user c…
Browse files Browse the repository at this point in the history
…onfig
  • Loading branch information
Tobias Sachs committed May 29, 2016
1 parent 2a70f7b commit 46de086
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion web/ia7/include/javascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,8 @@ var getButtonColor = function (state) {
} else if (state == "cooling" || state == "cool") {
color = "info";
}
if (json_store.ia7_config.state_colors[state] !== undefined) {
if (json_store.ia7_config.state_colors !== undefined
&& json_store.ia7_config.state_colors[state] !== undefined) {
color = "purple";
if (json_store.ia7_config.state_colors[state] == "green") {
color = "success";
Expand Down

0 comments on commit 46de086

Please sign in to comment.