From d2eb10b7e66213d43e00551170e77acc220c0ef8 Mon Sep 17 00:00:00 2001 From: Corey Hulen Date: Fri, 30 Jun 2017 17:19:04 -0700 Subject: [PATCH] Fixing JS error (#6813) * Fixing JS error * Fixing js error and storing issue --- webapp/utils/channel_utils.jsx | 2 +- webapp/utils/utils.jsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/webapp/utils/channel_utils.jsx b/webapp/utils/channel_utils.jsx index 1afce39b45..e3a9f04234 100644 --- a/webapp/utils/channel_utils.jsx +++ b/webapp/utils/channel_utils.jsx @@ -107,7 +107,7 @@ export function sortChannelsByDisplayName(a, b) { const aDisplayName = getChannelDisplayName(a); const bDisplayName = getChannelDisplayName(b); - if (aDisplayName !== bDisplayName) { + if (aDisplayName !== null && bDisplayName !== null && aDisplayName !== bDisplayName) { return aDisplayName.localeCompare(bDisplayName, locale, {numeric: true}); } diff --git a/webapp/utils/utils.jsx b/webapp/utils/utils.jsx index 56482a0fb2..68f43b543b 100644 --- a/webapp/utils/utils.jsx +++ b/webapp/utils/utils.jsx @@ -1011,7 +1011,7 @@ export function displayUsernameForUser(user) { return name; } - return null; + return ''; } // Converts a file size in bytes into a human-readable string of the form '123MB'.