maths: fix formulas outputing unwrapped null value

This commit is contained in:
jean-emmanuel 2018-03-03 10:57:09 +01:00
parent 5954789b69
commit fbcd0ecf45

View file

@ -322,7 +322,7 @@ class Widget extends EventEmitter {
if (r instanceof math.type.ResultSet && !r.entries.length) {
r = ''
} else if (r.valueOf) {
} else if (typeof r === 'object' && r !== null && r.valueOf) {
r = r.valueOf()
if (Array.isArray(r) && r.length == 1) r = r[0]
}