Преглед на файлове

VersionService: Handle undefined version in checkForUpdate

Danilo Bargen преди 8 години
родител
ревизия
279ae5a3cf
променени са 1 файла, в които са добавени 4 реда и са изтрити 0 реда
  1. 4 0
      src/services/version.ts

+ 4 - 0
src/services/version.ts

@@ -92,6 +92,10 @@ export class VersionService {
      */
     public checkForUpdate(): void {
         this.$log.debug(this.logTag, 'Checking for version update...');
+        if (this.version === undefined) {
+            this.$log.error(this.logTag, 'Cannot check for update, version is not initialized');
+            return;
+        }
         this.fetchVersion()
             .then((version: string) => {
                 if (version !== this.version) {