ui: eslint: fix undefined check master
authorDominik Csapak <d.csapak@proxmox.com>
Thu, 15 Sep 2022 09:48:24 +0000 (11:48 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 16 Sep 2022 10:50:56 +0000 (12:50 +0200)
'typeof' cannot return 'undefined' only the string '"undefined"', newer
eslint versions detect that as error

to fix it, directly check it for undefined instead of using typeof

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
www/manager6/storage/PBSEdit.js

index d880308cf5ce4c406fc8fa6a5029e051bf11b5a8..5b6b6bb8301ff99eca9b2e2f15cdbb1c29ef5c76 100644 (file)
@@ -365,7 +365,7 @@ Ext.define('PVE.panel.PBSEncryptionKeyTab', {
                            } catch (e) {
                                return "Failed to parse key - " + e;
                            }
-                           if (typeof key.data === undefined) {
+                           if (key.data === undefined) {
                                return "Does not seems like a valid Proxmox Backup key!";
                            }
                        }