diff --git a/js/CommonDialogs.js b/js/CommonDialogs.js index 491ebe426..e2dbfd3b0 100644 --- a/js/CommonDialogs.js +++ b/js/CommonDialogs.js @@ -325,7 +325,7 @@ const CommonDialogs = { addLabel: function() { const caption = prompt(__("Please enter label caption:"), ""); - if (caption !== undefined && caption.trim().length > 0) { + if (caption && caption.trim().length > 0) { const query = {op: "Pref_Labels", method: "add", caption: caption.trim()};