Resolve error when trying to decode faulty json
This commit is contained in:
@@ -23,7 +23,11 @@ function nodeDotPathToHistory(history: q.MessageHistory, dotPath: string) {
|
|||||||
return history
|
return history
|
||||||
.toArray()
|
.toArray()
|
||||||
.map((message: q.Message) => {
|
.map((message: q.Message) => {
|
||||||
const json = message.value ? JSON.parse(Base64Message.toUnicodeString(message.value)) : {}
|
let json = {}
|
||||||
|
try {
|
||||||
|
json = message.value ? JSON.parse(Base64Message.toUnicodeString(message.value)) : {}
|
||||||
|
} catch (ignore) {}
|
||||||
|
|
||||||
let value = dotProp.get(json, dotPath)
|
let value = dotProp.get(json, dotPath)
|
||||||
|
|
||||||
return { x: message.received.getTime(), y: toPlottableValue(value) }
|
return { x: message.received.getTime(), y: toPlottableValue(value) }
|
||||||
|
|||||||
Reference in New Issue
Block a user