mirror of
https://git.tt-rss.org/fox/tt-rss.git
synced 2026-05-04 15:16:10 +02:00
Error message when cancelling a label creation
When "Create label" menu is clicked, a popup asks for the label name. If the Cancel button is immediately entered, an error message is displayed: TypeError: can't access property "trim", caption is null. Indeed, the JavaScript prompt() message returns null when Cancel is pressed. The test "caption !== undefined" is thus true, and the trim() is tried on null, which fails. The fix is to only check for "caption" or "caption != null".
This commit is contained in:
parent
fc4cfb9d10
commit
4da5e11653
@ -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()};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user