Commit b7cfda1f1985477fd342a7651020c340ee0325f1
handle weird about messages where name/description are objects and not strings
Joran authored on 11/14/2018, 8:28:31 PMChristian Bundy committed on 11/14/2018, 9:13:59 PM
Parent: 811ef64cd3120bacda2030709c8f86850a10fe6f
Files changed
message/html/render/about.js | changed |
message/html/render/about.js | ||
---|---|---|
@@ -41,8 +41,14 @@ | ||
41 | 41 … | // TODO : build better normalizers |
42 | 42 … | if (image && ref.isBlob(image.link)) image = image.link |
43 | 43 … | about = about || link |
44 | 44 … | |
45 … | + // Safety check - are the incoming things actually text | |
46 … | + if(typeof name != 'string') | |
47 … | + name = undefined | |
48 … | + if(typeof description != 'string') | |
49 … | + description = undefined | |
50 … | + | |
45 | 51 … | const metaData = [ |
46 | 52 … | name ? h('div', [ h('strong', 'Name: '), name ]) : undefined, |
47 | 53 … | description ? h('div', [ h('strong', 'Description: '), description ]) : undefined, |
48 | 54 … | image ? h('img', { src: api.blob.sync.url(image), style: { 'margin-top': '.5rem' } }) : undefined |
Built with git-ssb-web