]> git.proxmox.com Git - pmg-gui.git/commitdiff
MailTracker: do not search when not both datetime parameters are given
authorDominik Csapak <d.csapak@proxmox.com>
Fri, 24 Apr 2020 13:57:55 +0000 (15:57 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 24 Apr 2020 15:41:02 +0000 (17:41 +0200)
in the gui, we always expect an end and starttime, the only case
where we do not get this is when the fields are invalid, so bail out
in that case instead of searching

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
js/MailTracker.js

index cee7732cc2f69d64a99458c51ff6a749df54e20a..61b0b5e51aab9dc0cd664765b0fccaf97734eb87 100644 (file)
@@ -49,6 +49,10 @@ Ext.define('PMG.MailTrackerFilter', {
            if (value) { param[name] = value; }
        });
 
+       // there must always be a start and endtime, otherwise the field was invalid
+       if (!param.starttime || !param.endtime) {
+           return undefined;
+       }
        return param;
     },
 
@@ -260,6 +264,9 @@ Ext.define('PMG.MailTracker', {
            var filter = this.lookupReference('filter');
            var status = this.lookupReference('status');
            var params = filter.getFilterParams();
+           if (params === undefined) {
+               return; // something went wrong with the filters bail out
+           }
            status.update(''); // clear status before load
            view.store.proxy.setExtraParams(params);
            view.store.proxy.setUrl('/api2/json/nodes/' + Proxmox.NodeName + '/tracker');