mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 15:03:34 +00:00
drafts: Catch and log error caused by drafts with undefined topics.
This is a bandaid fix to an error that came out of #22094. The error was fixed in #23238 but some drafts still have undefined topics which is raising this error. More details on CZO: https://chat.zulip.org/#narrow/stream/9-issues/topic/live.20update.20issue.20with.20drafts/near/1457913
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import _ from "lodash";
|
||||
|
||||
import * as blueslip from "./blueslip";
|
||||
import {$t} from "./i18n";
|
||||
|
||||
// From MDN: https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Math/random
|
||||
@@ -39,6 +40,10 @@ export function lower_bound(array, value, less) {
|
||||
}
|
||||
|
||||
export const lower_same = function lower_same(a, b) {
|
||||
if (a === undefined || b === undefined) {
|
||||
blueslip.error(`Cannot compare strings; at least one value is undefined: ${a}, ${b}`);
|
||||
return false;
|
||||
}
|
||||
return a.toLowerCase() === b.toLowerCase();
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user