plot: prevent json parse attempt to throw

This commit is contained in:
jean-emmanuel 2018-02-13 13:14:37 +01:00
parent 2ac9563eed
commit b0c020405a

View file

@ -174,8 +174,10 @@ module.exports = class _plots_base extends Canvas {
setValue(v, options={}) {
if (typeof v == 'string' && (v[0] == '[' || v[0] == '{' )) {
v = JSON.parseFlex(v)
if (typeof v == 'string') {
try {
v = JSON.parseFlex(v)
} catch(err) {}
}
if (typeof v == 'object') {