aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/serve.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/serve.js b/lib/serve.js
index d87880c..f71e083 100644
--- a/lib/serve.js
+++ b/lib/serve.js
@@ -3936,17 +3936,17 @@ Serve.prototype.aboutDiff = function (url) {
? pull.values(['next: ', ph('a', {href: nextHref}, ph('code',
nextMsg.key.substr(0, 8) + '…'))])
: pull.empty(),
- prevMsg ? self.textEditDiffTable(prevMsg, msg) : pull.empty()
+ prevMsg || msg ? self.textEditDiffTable(prevMsg, msg) : pull.empty()
]))
}
}
}
Serve.prototype.textEditDiffTable = function (oldMsg, newMsg) {
- var oldC = oldMsg.value.content || {}
- var newC = newMsg.value.content || {}
- var oldText = String(oldC.text || oldC.description)
- var newText = String(newC.text || newC.description)
+ var oldC = oldMsg && oldMsg.value.content || {}
+ var newC = newMsg && newMsg.value.content || {}
+ var oldText = String(oldC.text || oldC.description || '')
+ var newText = String(newC.text || newC.description || '')
var diff = Diff.structuredPatch('', '', oldText, newText)
var self = this
return pull(