repositories
/
e-mobility-charging-stations-simulator.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
refactor(simulator): use helper for undefined or null checks
[e-mobility-charging-stations-simulator.git]
/
src
/
charging-station
/
ui-server
/
ui-services
/
AbstractUIService.ts
diff --git
a/src/charging-station/ui-server/ui-services/AbstractUIService.ts
b/src/charging-station/ui-server/ui-services/AbstractUIService.ts
index 0a636edbe8fc07bbd66ebf4be11d24e0e60842e8..900b79d5d1789fc7e5757166b920ab85330c67d2 100644
(file)
--- a/
src/charging-station/ui-server/ui-services/AbstractUIService.ts
+++ b/
src/charging-station/ui-server/ui-services/AbstractUIService.ts
@@
-98,7
+98,7
@@
export abstract class AbstractUIService {
};
} finally {
// Send response for payload not forwarded to broadcast channel
};
} finally {
// Send response for payload not forwarded to broadcast channel
- if (
responsePayload !== undefined
) {
+ if (
!Utils.isNullOrUndefined(responsePayload)
) {
this.sendResponse(messageId, responsePayload);
}
}
this.sendResponse(messageId, responsePayload);
}
}
@@
-151,7
+151,7
@@
export abstract class AbstractUIService {
): void {
if (Utils.isNotEmptyArray(payload.hashIds)) {
payload.hashIds = payload.hashIds
): void {
if (Utils.isNotEmptyArray(payload.hashIds)) {
payload.hashIds = payload.hashIds
- .filter((hashId) =>
hashId !== undefined
)
+ .filter((hashId) =>
!Utils.isNullOrUndefined(hashId)
)
.map((hashId) => {
if (this.uiServer.chargingStations.has(hashId) === true) {
return hashId;
.map((hashId) => {
if (this.uiServer.chargingStations.has(hashId) === true) {
return hashId;