Add console error for heroku log.

Fix bug where there was not check on undefined metadata.
Fix bug where claims from list trending are not part of a channel.
This commit is contained in:
Mark Beamer Jr 2019-09-01 22:30:22 -04:00
parent 5bc4650ad1
commit 94136dbb69
No known key found for this signature in database
GPG key ID: 1C314FB89AD76973
2 changed files with 5 additions and 3 deletions

View file

@ -260,6 +260,7 @@ export default async(data, socket) => {
return response.body.result[Object.keys(response.body.result)[0]];
} catch(error) {
console.error(error);
messageSlack({
message: "```" + error + "```",
pretext: "_Someone is going through the Playground and the daemon is not running_",

View file

@ -136,9 +136,10 @@ function generateContent(exampleNumber, displayTrendingContent) {
Promise.all(rawContentCollection)
.then(collection => {
for (const part of collection) {
if (part.value.tags && part.value.tags.includes("mature"))
if (part && part.value.tags && part.value.tags.includes("mature"))
continue;
if (part === undefined)
continue;
try {
renderedContentCollection.push(`
<section class="playground-content__trend">
@ -154,7 +155,7 @@ function generateContent(exampleNumber, displayTrendingContent) {
</div>
<div class="media__subtitle">
${part.signing_channel.name || "Anon"}
${part.signing_channel ? part.signing_channel.name : "Anon"}
</div>
</section>
`);