git ssb

30+

cel / git-ssb-web



Commit 1d9e51d877533a7ee7791bb1d85c793c746ac193

Handle missing value (sync message) from links

Charles Lehner committed on 5/24/2016, 3:36:17 PM
Parent: d36c25d80e23ebfa5b2010d14d2613721e83f2ff

Files changed

lib/about.jschanged
lib/repos/index.jschanged
lib/repos/issues.jschanged
lib/users.jschanged
lib/about.jsView
@@ -59,9 +59,9 @@
5959 reverse: true
6060 }),
6161 ]),
6262 pull.filter(function (msg) {
63- return msg && msg.value.content
63+ return msg && msg.value && msg.value.content
6464 }),
6565 pull.drain(function (msg) {
6666 if (info.name && info.image) return false
6767 var c = msg.value.content
@@ -85,8 +85,9 @@
8585 values: true,
8686 gte: Date.now()
8787 }),
8888 pull.drain(function (msg) {
89+ if (!msg.value) return
8990 var c = msg.value.content
9091 if (msg.value.author == source || msg.value.author == owner) {
9192 // TODO: give about from source (self) priority over about from owner
9293 if (c.name)
lib/repos/index.jsView
@@ -858,9 +858,10 @@
858858 rel: 'upstream'
859859 })
860860 ]),
861861 pull.filter(function (msg) {
862- return msg.value.content && msg.value.content.type == 'git-repo'
862+ var c = msg && msg.value && msg.value.content
863+ return c && c.type == 'git-repo'
863864 }),
864865 paramap(function (msg, cb) {
865866 self.web.getRepoFullName(msg.value.author, msg.key,
866867 function (err, repoName, authorName) {
lib/repos/issues.jsView
@@ -135,9 +135,10 @@
135135 u.sortMsgs(),
136136 pull.through(function (msg) {
137137 // the newest message in the issue thread
138138 // becomes the branch of the new post
139- if (msg.value.timestamp > newestMsg.value.timestamp
139+ if (msg.value
140+ && msg.value.timestamp > newestMsg.value.timestamp
140141 && msg.value.content.root == issue.id)
141142 newestMsg = msg
142143 }),
143144 pull.map(self.renderIssueActivityMsg.bind(self, req, repo, issue,
lib/users.jsView
@@ -118,8 +118,9 @@
118118 }),
119119 pull.unique('dest'),
120120 u.sortMsgs(true),
121121 paramap(function (link, cb) {
122+ if (!link.dest) return cb()
122123 self.web.getMsg(link.dest, function (err, destMsg) {
123124 if (err) return cb(err)
124125 if (destMsg.content.type != 'git-repo') return cb()
125126 var vote = link.value.content && link.value.content.vote

Built with git-ssb-web