FIX: Search menu widget breaks when context type is null.

This commit is contained in:
Guo Xiang Tan 2017-02-03 09:38:51 +08:00
parent c392994793
commit 7a243e859e

View File

@ -85,7 +85,7 @@ export default createWidget('search-menu', {
query += `q=${encodeURIComponent(searchData.term)}`; query += `q=${encodeURIComponent(searchData.term)}`;
if (contextEnabled) { if (contextEnabled && ctx) {
if (this.currentUser && if (this.currentUser &&
ctx.id.toString().toLowerCase() === this.currentUser.username_lower && ctx.id.toString().toLowerCase() === this.currentUser.username_lower &&
type === "private_messages") { type === "private_messages") {