diff --git a/index.html b/index.html index 64ffb424..c1e650a6 100644 --- a/index.html +++ b/index.html @@ -65,7 +65,8 @@ // Make a data URL from public.photo function makeImageUrl(photo) { - return photo ? 'data:image/' + photo.type + ';base64,' + photo.data : null; + return (photo && photo.type && photo.data) ? + 'data:image/' + photo.type + ';base64,' + photo.data : null; } /* BEGIN Popup/dropdown menu */ @@ -514,7 +515,7 @@ title = "Edit Account"; break; case 'contacts': title = this.props.title; - avatar = this.props.avatar; + avatar = this.props.avatar ? this.props.avatar : true; break; case 'new-topic': title = "Start New Chat"; @@ -871,14 +872,16 @@ }, handleSearch: function(e) { e.preventDefault(); - console.log("will search for '" + this.state.search + "'"); + // Split query string by either space or comma, filter out empty strings. + var query = this.state.search.split(/[,\s]/).filter(Boolean); + console.log("will search for ", query); }, render: function() { return (