diff --git a/src/app/tabs/compile-tab.js b/src/app/tabs/compile-tab.js
index 29974ab3ba..0c66936562 100644
--- a/src/app/tabs/compile-tab.js
+++ b/src/app/tabs/compile-tab.js
@@ -383,11 +383,19 @@ function compileTab (container, appAPI, appEvents, opts) {
return ret
}
})
- node = yo`
${treeView.render(JSON.parse(details[x]))}
`
+ if (details[x] !== '') {
+ try {
+ node = yo`${treeView.render(JSON.parse(details[x]))}
` // catch in case the parsing fails.
+ } catch (e) {
+ node = yo`Unable to display "${x}": ${e.message}
`
+ }
+ } else {
+ node = yo` -
`
+ }
} else {
node = yo`${JSON.stringify(details[x], null, 4)}
`
}
- value.appendChild(node)
+ if (node) value.appendChild(node)
return value
}