Repository: flex-utilities
Updated Branches:
  refs/heads/develop d88b29d1f -> 465ff18f2


make sure writing log doesn't cause an error itself


Project: http://git-wip-us.apache.org/repos/asf/flex-utilities/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-utilities/commit/465ff18f
Tree: http://git-wip-us.apache.org/repos/asf/flex-utilities/tree/465ff18f
Diff: http://git-wip-us.apache.org/repos/asf/flex-utilities/diff/465ff18f

Branch: refs/heads/develop
Commit: 465ff18f225900c4806e796e0c0826171dc6f4fa
Parents: d88b29d
Author: Justin Mclean <jmcl...@apache.org>
Authored: Sun Jul 6 14:38:55 2014 +1000
Committer: Justin Mclean <jmcl...@apache.org>
Committed: Sun Jul 6 14:38:55 2014 +1000

----------------------------------------------------------------------
 installer/src/InstallApacheFlex.mxml | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/465ff18f/installer/src/InstallApacheFlex.mxml
----------------------------------------------------------------------
diff --git a/installer/src/InstallApacheFlex.mxml 
b/installer/src/InstallApacheFlex.mxml
index 8ddceb0..eb8e94d 100644
--- a/installer/src/InstallApacheFlex.mxml
+++ b/installer/src/InstallApacheFlex.mxml
@@ -2287,15 +2287,24 @@ variables are not required because the locations of 
these pieces are known.
                }
                
                protected function saveLogToDisk():void {
+                       if (!_flexHomeDir) {
+                               return; 
+                       }
+                       
                        var file:File = file = 
_flexHomeDir.resolvePath("installer.log");
                        var fs:FileStream = new FileStream();
             
-                       fs.open(file, FileMode.WRITE);
-                       for each (var message:String in _messages) {
-               fs.writeUTFBytes(message);
-                               fs.writeUTFBytes("\n");
+                       try {
+                               fs.open(file, FileMode.WRITE);
+                               for each (var message:String in _messages) {
+                       fs.writeUTFBytes(message);
+                                       fs.writeUTFBytes("\n");
+                               }
+                   fs.close();
+                       }
+                       catch (e:Error) {
+                       // TODO log error?
                        }
-            fs.close();
                }
                
                protected function updateUIHandleInstallationComplete():void {

Reply via email to