Commit 1d9e51d877533a7ee7791bb1d85c793c746ac193
Handle missing value (sync message) from links
Charles Lehner committed on 5/24/2016, 3:36:17 PMParent: d36c25d80e23ebfa5b2010d14d2613721e83f2ff
Files changed
lib/about.js | changed |
lib/repos/index.js | changed |
lib/repos/issues.js | changed |
lib/users.js | changed |
lib/about.js | ||
---|---|---|
@@ -59,9 +59,9 @@ | ||
59 | 59 | reverse: true |
60 | 60 | }), |
61 | 61 | ]), |
62 | 62 | pull.filter(function (msg) { |
63 | - return msg && msg.value.content | |
63 | + return msg && msg.value && msg.value.content | |
64 | 64 | }), |
65 | 65 | pull.drain(function (msg) { |
66 | 66 | if (info.name && info.image) return false |
67 | 67 | var c = msg.value.content |
@@ -85,8 +85,9 @@ | ||
85 | 85 | values: true, |
86 | 86 | gte: Date.now() |
87 | 87 | }), |
88 | 88 | pull.drain(function (msg) { |
89 | + if (!msg.value) return | |
89 | 90 | var c = msg.value.content |
90 | 91 | if (msg.value.author == source || msg.value.author == owner) { |
91 | 92 | // TODO: give about from source (self) priority over about from owner |
92 | 93 | if (c.name) |
lib/repos/index.js | ||
---|---|---|
@@ -858,9 +858,10 @@ | ||
858 | 858 | rel: 'upstream' |
859 | 859 | }) |
860 | 860 | ]), |
861 | 861 | 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' | |
863 | 864 | }), |
864 | 865 | paramap(function (msg, cb) { |
865 | 866 | self.web.getRepoFullName(msg.value.author, msg.key, |
866 | 867 | function (err, repoName, authorName) { |
lib/repos/issues.js | ||
---|---|---|
@@ -135,9 +135,10 @@ | ||
135 | 135 | u.sortMsgs(), |
136 | 136 | pull.through(function (msg) { |
137 | 137 | // the newest message in the issue thread |
138 | 138 | // 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 | |
140 | 141 | && msg.value.content.root == issue.id) |
141 | 142 | newestMsg = msg |
142 | 143 | }), |
143 | 144 | pull.map(self.renderIssueActivityMsg.bind(self, req, repo, issue, |
lib/users.js | ||
---|---|---|
@@ -118,8 +118,9 @@ | ||
118 | 118 | }), |
119 | 119 | pull.unique('dest'), |
120 | 120 | u.sortMsgs(true), |
121 | 121 | paramap(function (link, cb) { |
122 | + if (!link.dest) return cb() | |
122 | 123 | self.web.getMsg(link.dest, function (err, destMsg) { |
123 | 124 | if (err) return cb(err) |
124 | 125 | if (destMsg.content.type != 'git-repo') return cb() |
125 | 126 | var vote = link.value.content && link.value.content.vote |
Built with git-ssb-web