public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH manager] ui: eslint: fix undefined check
@ 2022-09-15  9:48 Dominik Csapak
  2022-09-16 10:51 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Dominik Csapak @ 2022-09-15  9:48 UTC (permalink / raw)
  To: pve-devel

'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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/www/manager6/storage/PBSEdit.js b/www/manager6/storage/PBSEdit.js
index d880308c..5b6b6bb8 100644
--- a/www/manager6/storage/PBSEdit.js
+++ b/www/manager6/storage/PBSEdit.js
@@ -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!";
 			    }
 			}
-- 
2.30.2





^ permalink raw reply	[flat|nested] 2+ messages in thread

* [pve-devel] applied: [PATCH manager] ui: eslint: fix undefined check
  2022-09-15  9:48 [pve-devel] [PATCH manager] ui: eslint: fix undefined check Dominik Csapak
@ 2022-09-16 10:51 ` Thomas Lamprecht
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2022-09-16 10:51 UTC (permalink / raw)
  To: Proxmox VE development discussion, Dominik Csapak

Am 15/09/2022 um 11:48 schrieb Dominik Csapak:
> '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 | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
>

applied, thanks!




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-09-16 10:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-15  9:48 [pve-devel] [PATCH manager] ui: eslint: fix undefined check Dominik Csapak
2022-09-16 10:51 ` [pve-devel] applied: " Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal