diff --git a/projects/editor/src/app/services/unit.service.ts b/projects/editor/src/app/services/unit.service.ts
index 75befb2a4a28b71da105875884f8554dc8cb7a74..ac51972d254c6049bba434e54a631036e5901e4d 100644
--- a/projects/editor/src/app/services/unit.service.ts
+++ b/projects/editor/src/app/services/unit.service.ts
@@ -48,7 +48,9 @@ export class UnitService {
   loadUnitDefinition(unitDefinition: string): void {
     this.idService.reset();
     const sanatizationResult = UnitDefinitionSanitizer.sanitizeUnitDefinition(JSON.parse(unitDefinition));
-    if (sanatizationResult[1]) this.messageService.showWarning('Loaded outdated unit definition.');
+    if (unitDefinition) {
+      if (sanatizationResult[1]) this.messageService.showWarning('Loaded outdated unit definition.');
+    }
     this.unit = UnitFactory.createUnit(sanatizationResult[0]);
     UnitService.readIDs(this.unit);
   }