diff options
author | Yoshie Muranaka <yoshiemuranaka@gmail.com> | 2021-02-01 18:48:53 +0300 |
---|---|---|
committer | Derick Montague <derick.montague@ibm.com> | 2021-02-04 00:41:48 +0300 |
commit | dada89cf0c79a7daa7fb943f8f83455a61ad1ecd (patch) | |
tree | 748f56c59744c1a4fc978a8410b6df51e0611855 /src/store/modules/Control/ControlStore.js | |
parent | bbf896c2ae84fc07c399c918c1c1f3f733cf6e19 (diff) | |
download | webui-vue-dada89cf0c79a7daa7fb943f8f83455a61ad1ecd.tar.xz |
Add property check on Server power operations page
Check for LastResetTime value before attempting to create a
Date object. The error causes the page to hang when attempting
different actions from the page.
Signed-off-by: Yoshie Muranaka <yoshiemuranaka@gmail.com>
Change-Id: Ia2d754e430d1d3ad69f04d3c350c68ca35fa5375
Diffstat (limited to 'src/store/modules/Control/ControlStore.js')
-rw-r--r-- | src/store/modules/Control/ControlStore.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/store/modules/Control/ControlStore.js b/src/store/modules/Control/ControlStore.js index 82940f81..5f532d0e 100644 --- a/src/store/modules/Control/ControlStore.js +++ b/src/store/modules/Control/ControlStore.js @@ -54,8 +54,10 @@ const ControlStore = { .get('/redfish/v1/Systems/system') .then((response) => { const lastReset = response.data.LastResetTime; - const lastPowerOperationTime = new Date(lastReset); - commit('setLastPowerOperationTime', lastPowerOperationTime); + if (lastReset) { + const lastPowerOperationTime = new Date(lastReset); + commit('setLastPowerOperationTime', lastPowerOperationTime); + } }) .catch((error) => console.log(error)); }, |