From aba8df7708e1a3e9684de0f9257599ed074807b5 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Fri, 23 Apr 2021 19:48:36 +1000 Subject: [PATCH] make return value match mergeTooltipAndShortcut() signature --- ts/editor-toolbar/helpers.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ts/editor-toolbar/helpers.ts b/ts/editor-toolbar/helpers.ts index cb33d3c7f..039e5919d 100644 --- a/ts/editor-toolbar/helpers.ts +++ b/ts/editor-toolbar/helpers.ts @@ -4,6 +4,10 @@ export function mergeTooltipAndShortcut( tooltip: string | undefined, shortcutLabel: string | undefined ): string | undefined { + if (!tooltip && !shortcutLabel) { + return undefined; + } + let buf = tooltip ?? ""; if (shortcutLabel) { buf = `${buf} (${shortcutLabel})`;