]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/toolchain/Preferences.java
1. Fix EDKT449 Close Build Preferences will crash wizard
[mirror_edk2.git] / Tools / Java / Source / FrameworkWizard / src / org / tianocore / frameworkwizard / toolchain / Preferences.java
index b7acc7da29414752105a9097ab8d0b0a20442582..17e5afe7ddf28ad75f9dd46d06d4ecb249fa070a 100644 (file)
@@ -162,7 +162,7 @@ public class Preferences extends IFrame {
 \r
     private JTextField jTextFieldThreadCount = null;\r
     \r
-    private String threadCount;\r
+    private String threadCount = "";\r
     \r
     private boolean threadEnabled = false;\r
 \r
@@ -547,7 +547,6 @@ public class Preferences extends IFrame {
      * \r
      */\r
     private void init() {\r
-\r
         for (int i = 0; i < maxTargetLines; i++) {\r
             targetLines[i] = null;\r
             targetLineNumber[i] = -1;\r
@@ -556,7 +555,7 @@ public class Preferences extends IFrame {
         this.setSize(dialogWidth, dialogHeight);\r
         this.setContentPane(getJContentPane());\r
         this.setTitle("Build Preferences [" + toolsDefIdentifier + "]");\r
-        this.setDefaultCloseOperation(IFrame.EXIT_ON_CLOSE);\r
+        this.setDefaultCloseOperation(IFrame.DISPOSE_ON_CLOSE);\r
         this.centerWindow();\r
         this.setVisible(true);\r
     }\r
@@ -1119,6 +1118,9 @@ public class Preferences extends IFrame {
         File toFile = new File(bakFile);\r
         FileInputStream fromTxt = null;\r
         FileOutputStream toBak = null;\r
+        if (!fromFile.exists()) {\r
+            fromFile.createNewFile();\r
+        }\r
         try {\r
             fromTxt = new FileInputStream(fromFile);\r
             toBak = new FileOutputStream(toFile);\r