Rename a type definition
[e-mobility-charging-stations-simulator.git] / src / utils / FileUtils.ts
index cab28941e730f831ed58f3639863ecfa97767bfd..5c15734bfe97cbf7857b3199f53ece7114ff1368 100644 (file)
@@ -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,