]> git.proxmox.com Git - proxmox-widget-toolkit.git/commitdiff
edit window: make response handling code path more robust
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 16 Feb 2022 06:57:54 +0000 (07:57 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 16 Feb 2022 06:58:27 +0000 (07:58 +0100)
A 2xx error code doesn't necessarily mean we got data we can
dereference

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/window/Edit.js

index 264b1ca0ca995c67655273b2ce8f5a4847bd65c9..488642de7abd3b5a110fb15137b77a3f5bea6740 100644 (file)
@@ -222,7 +222,7 @@ Ext.define('Proxmox.window.Edit', {
                method: 'GET',
                success: function(response, opts) {
                    form.clearInvalid();
-                   me.digest = response.result.digest || response.result.data.digest;
+                   me.digest = response.result?.digest || response.result?.data?.digest;
                    if (successFn) {
                        successFn(response, opts);
                    } else {