Skip to content

Commit

Permalink
State Dev: Allow whitespace in state attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
balloob committed Jan 30, 2017
1 parent b9cf35c commit 7a4b6f7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion panels/dev-state/ha-panel-dev-state.html
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,10 @@ <h1>Current entities</h1>

handleSetState: function () {
var attr;
var attrRaw = this._stateAttributes.replace(/^\s+|\s+$/g, '')
try {
attr = this._stateAttributes ? JSON.parse(this._stateAttributes) : {};
attr = attrRaw ?
JSON.parse(attrRaw) : {};
} catch (err) {
/* eslint-disable no-alert */
alert('Error parsing JSON: ' + err);
Expand Down

0 comments on commit 7a4b6f7

Please sign in to comment.