summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJannik Schönartz2021-06-24 14:32:18 +0200
committerJannik Schönartz2021-06-24 14:32:18 +0200
commitb296a7311b9d27c56014cc7b35802ead4e2a0e1f (patch)
treec7527f89e750eb09e58f2b7028be3d1882684cdd
parent[server/external-backends/idoit] Small undefined read fix (diff)
downloadbas-b296a7311b9d27c56014cc7b35802ead4e2a0e1f.tar.gz
bas-b296a7311b9d27c56014cc7b35802ead4e2a0e1f.tar.xz
bas-b296a7311b9d27c56014cc7b35802ead4e2a0e1f.zip
[server/external-backends/idoit] Small undefined read fix
-rw-r--r--server/lib/external-backends/backends/idoit-backend.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/server/lib/external-backends/backends/idoit-backend.js b/server/lib/external-backends/backends/idoit-backend.js
index 1c328ec..4abc81e 100644
--- a/server/lib/external-backends/backends/idoit-backend.js
+++ b/server/lib/external-backends/backends/idoit-backend.js
@@ -524,7 +524,7 @@ class IdoitBackend extends ExternalBackends {
}
// Update the object. CPU data.
- if (client.cpus) {
+ if (client.cpus && client.cpus.length > 0) {
const boundedCpus = boundObjects.filter(response => response.id.startsWith('READ_C__CATG__CPU'))[0].result
.map(cpu => {
return {
@@ -571,7 +571,7 @@ class IdoitBackend extends ExternalBackends {
}
// GPUS
- if (client.gpus) {
+ if (client.gpus && client.gpus.length > 0) {
const boundedGpus = boundObjects.filter(response => response.id.startsWith('READ_C__CATG__GRAPHIC'))[0].result
.map(gpu => {
return {
@@ -611,7 +611,7 @@ class IdoitBackend extends ExternalBackends {
}
// Update the object. Ram data.
- if (client.ram) {
+ if (client.ram && client.ram.modules && client.ram.modules.length > 0) {
const boundedRams = boundObjects.filter(response => response.id.startsWith('READ_C__CATG__MEMORY'))[0].result
.map(bRam => {
return {
@@ -663,7 +663,7 @@ class IdoitBackend extends ExternalBackends {
}
// Update the object. Drive data.
- if (client.drives) {
+ if (client.drives && client.drives.length > 0) {
const boundedDrives = boundObjects.filter(response => response.id.startsWith('READ_C__CATG__STORAGE_DEVICE'))[0].result
.map(bDrive => {
return {
@@ -722,7 +722,7 @@ class IdoitBackend extends ExternalBackends {
}
// Add Monitors
- if (client.monitors) {
+ if (client.monitors && client.monitors.length > 0) {
// Monitor is a custom object, therefore the fieldnames can be looked up in the idoit interface / api
const boundedMonitors = boundObjects.filter(response => response.id.startsWith('READ_C__CATG__CUSTOM_FIELDS_MONITOR'))[0].result
.map(bMonitor => {