Skip to content

Commit ecb847d

Browse files
committed
Fixed the bug of JSON.parse when the config attribute is undefiend.
1 parent a2df1a0 commit ecb847d

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

dist/angular-fusioncharts.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/angular-fusioncharts.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -303,12 +303,15 @@
303303
'config': {
304304
ifExist: false,
305305
observer: function (newVal) {
306-
var configObj = JSON.parse(newVal),
307-
attr;
308-
for (attr in configObj) {
309-
chartConfigObject[attr] = configObj[attr];
306+
var configObj;
307+
if (newVal) {
308+
configObj = JSON.parse(newVal),
309+
attr;
310+
for (attr in configObj) {
311+
chartConfigObject[attr] = configObj[attr];
312+
}
313+
createFCChart();
310314
}
311-
createFCChart();
312315
}
313316
}
314317
},

0 commit comments

Comments
 (0)