From 1b28b610476fe1e34bd5c6ecbf98fe5f5add000b Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Fri, 22 Mar 2024 15:10:00 +0000 Subject: [PATCH] Prevent bad date values in state file --- js/app/controllers/DownloadModule.js | 4 ++++ 1 file changed, 4 insertions(+), 0 deletions(-) diff --git a/js/app/controllers/DownloadModule.js b/js/app/controllers/DownloadModule.js index 2bd8354..c7e2c0d 100644 --- a/js/app/controllers/DownloadModule.js +++ b/js/app/controllers/DownloadModule.js @@ -39,6 +39,10 @@ Ext.define('amdaDesktop.DownloadModule', { var form = uiContent.down('form').getForm(); var values = form.getValues(); // Ext.state.Manager.set(this.id + '_form', values); + if (Number.isNaN(Date.parse(values.startDate)) || Number.isNaN(Date.parse(values.stopDate))) { + return; + } + Ext.state.Manager.set('timeinterval', {'startDate' : values.startDate,'stopDate' : values.stopDate }); }, -- libgit2 0.21.2