Browse Source

prevent editor from crashing when recentFiles is undefined

rsredsq 10 years ago
parent
commit
409350e0fd
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Script/AtomicEditor/utils/Preferences.ts

+ 1 - 1
Script/AtomicEditor/utils/Preferences.ts

@@ -58,7 +58,7 @@ class Preferences {
         var jsonFile = new Atomic.File(filePath, Atomic.FILE_READ);
         if (!jsonFile.isOpen()) return;
         var prefs = <PreferencesFormat> JSON.parse(jsonFile.readText());
-        this._recentProjects = prefs.recentFiles;
+        this._recentProjects = prefs.recentFiles || [""];
         this._androidSDKPath = prefs.androidSdkPath;
         this._jdkRootPath = prefs.jdkRootPath;
         this._antPath = prefs.antPath;