diff --git a/frontend_tests/node_tests/drafts.js b/frontend_tests/node_tests/drafts.js index d44b7bacae..f9e9d9bad7 100644 --- a/frontend_tests/node_tests/drafts.js +++ b/frontend_tests/node_tests/drafts.js @@ -413,7 +413,7 @@ test("catch_buggy_draft_error", () => { // An error is logged but the draft isn't fixed in this codepath. blueslip.expect( "error", - "Cannot compare strings; at least one value is undefined: undefined, old_topic", + "Cannot compare strings; at least one value is undefined: (undefined), old_topic", ); drafts.rename_stream_recipient( stream_B.stream_id, diff --git a/static/js/util.js b/static/js/util.js index f20aad4bc5..fe5a722d78 100644 --- a/static/js/util.js +++ b/static/js/util.js @@ -41,7 +41,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}`); + blueslip.error( + `Cannot compare strings; at least one value is undefined: \ +${a ?? "(undefined)"}, ${b ?? "(undefined)"}`, + ); return false; } return a.toLowerCase() === b.toLowerCase();