arj03 / ssb-browser-demo

A secure scuttlebutt client interface running in the browser
Other
58 stars 11 forks source link

Fix issue where profile description could cause an error #306

Closed KyleMaas closed 3 years ago

KyleMaas commented 3 years ago

So...in trying to fix #305, it turns out that we were already checking if the description was undefined, and self was already set to this. There were no code paths I could find which would result in this.descriptionText to actually be undefined. But it was possible for the error to show up if a profile's description was something other than a string where matchAll was not defined on it. So under the premise that that's probably actually what was causing that error, this changes the this reference to self for consistency and adds a check to ensure that the description is actually a string before trying to run the regular expression on it.

Fixes #305

arj03 commented 3 years ago

That looks great. Thanks :)