prop maths: strip out empty resultsets (when just assigning vars)

This commit is contained in:
jean-emmanuel 2018-02-16 11:13:54 +01:00
parent 66b0e35e13
commit b8074e558c

View file

@ -315,10 +315,13 @@ class Widget extends EventEmitter {
let r = this.parsers[m].eval(variables)
if (r.valueOf) {
if (r instanceof math.type.ResultSet && !r.entries.length) {
r = ''
} else if (r.valueOf) {
r = r.valueOf()
if (Array.isArray(r) && r.length == 1) r = r[0]
}
return typeof r != 'string' ? JSON.stringify(r) : r
})
} catch (err) {}