ide/extras/PathBox: Fixed crash (http://ecere.com/mantis/view.php?id=600) in NewProje...
authorJerome St-Louis <jerome@ecere.com>
Wed, 24 Aug 2011 23:35:58 +0000 (19:35 -0400)
committerJerome St-Louis <jerome@ecere.com>
Wed, 24 Aug 2011 23:35:58 +0000 (19:35 -0400)
extras/gui/controls/PathBox.ec

index 5fb4d37..2430729 100644 (file)
@@ -419,7 +419,7 @@ public class PathBox : CommonControl
             char fileName[MAX_LOCATION];//, filePath[MAX_LOCATION];
             DirectoriesBox dirBox = (DirectoriesBox)parent.parent;
             if(dirBox) { dirBox = (DirectoriesBox)dirBox.parent; } // TOFIX: Precomp needs { }
-            if(!eClass_IsDerived(dirBox._class, class(DirectoriesBox))) dirBox = null;
+            if(dirBox && !eClass_IsDerived(dirBox._class, class(DirectoriesBox))) dirBox = null;
 
             incref this;
 
@@ -564,7 +564,8 @@ public:
          char path[MAX_LOCATION];
          GetSystemPathBuffer(path, value);
          editBox.contents = path;
-         editBox.SelectAll();
+         if(active)
+            editBox.SelectAll();
          CheckFileExists();
       }
       get { return editBox.contents; }