summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorYoshie Muranaka <yoshiemuranaka@gmail.com>2021-02-01 18:48:53 +0300
committerDerick Montague <derick.montague@ibm.com>2021-02-04 00:41:48 +0300
commitdada89cf0c79a7daa7fb943f8f83455a61ad1ecd (patch)
tree748f56c59744c1a4fc978a8410b6df51e0611855 /src
parentbbf896c2ae84fc07c399c918c1c1f3f733cf6e19 (diff)
downloadwebui-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')
-rw-r--r--src/store/modules/Control/ControlStore.js6
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));
},