common: Account for string.match returning null.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
Anders Kaseorg
2020-02-13 15:57:20 -08:00
committed by Anders Kaseorg
parent 41e3db81be
commit 11bec3e6b5

View File

@@ -117,7 +117,7 @@ exports.adjust_mac_shortcuts = function (key_elem_class, require_cmd_style) {
$(key_elem_class).each(function () {
let key_text = $(this).text();
const keys = key_text.match(/[^\s\+]+/g);
const keys = key_text.match(/[^\s\+]+/g) || [];
if (key_text.includes('Ctrl') && require_cmd_style) {
$(this).addClass("mac-cmd-key");