repositories
/
e-mobility-charging-stations-simulator.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e689539
)
watchJsonFile: ensure the argument is defined before assigning it
author
Jérôme Benoit
<jerome.benoit@sap.com>
Sat, 12 Mar 2022 12:19:16 +0000
(13:19 +0100)
committer
Jérôme Benoit
<jerome.benoit@sap.com>
Sat, 12 Mar 2022 12:20:40 +0000
(13:20 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/utils/FileUtils.ts
patch
|
blob
|
blame
|
history
diff --git
a/src/utils/FileUtils.ts
b/src/utils/FileUtils.ts
index cab28941e730f831ed58f3639863ecfa97767bfd..5c15734bfe97cbf7857b3199f53ece7114ff1368 100644
(file)
--- a/
src/utils/FileUtils.ts
+++ b/
src/utils/FileUtils.ts
@@
-18,7
+18,7
@@
export default class FileUtils {
if (filename && event === 'change') {
try {
logger.debug(logPrefix + ' ' + fileType + ' file ' + file + ' have changed, reload');
- attribute
= JSON.parse(fs.readFileSync(file, 'utf8')) as T
;
+ attribute
&& (attribute = JSON.parse(fs.readFileSync(file, 'utf8')) as T)
;
} catch (error) {
FileUtils.handleFileException(logPrefix, fileType, file, error as NodeJS.ErrnoException, {
throwError: false,