Author: jpobst
Date: 2008-01-16 14:12:33 -0500 (Wed, 16 Jan 2008)
New Revision: 93082

Modified:
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
   
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/FolderBrowserDialog.cs
Log:
2008-01-16  Jonathan Pobst  <[EMAIL PROTECTED]>

        * FolderBrowserDialog.cs: If we cannot interpret the user's requested
        SelectedPath, just display the default dialog instead of crashing.
        [Fixes bug #348989]

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2008-01-16 19:09:05 UTC (rev 93081)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2008-01-16 19:12:33 UTC (rev 93082)
@@ -1,3 +1,9 @@
+2008-01-16  Jonathan Pobst  <[EMAIL PROTECTED]>
+
+       * FolderBrowserDialog.cs: If we cannot interpret the user's requested
+       SelectedPath, just display the default dialog instead of crashing.
+       [Fixes bug #348989]
+
 2008-01-16  Geoff Norton  <[EMAIL PROTECTED]>
 
        * XplatUICarbon.cs:  Avoid some unecessary invalidation calls when

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/FolderBrowserDialog.cs
===================================================================
--- 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/FolderBrowserDialog.cs
   2008-01-16 19:09:05 UTC (rev 93081)
+++ 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/FolderBrowserDialog.cs
   2008-01-16 19:12:33 UTC (rev 93082)
@@ -384,8 +384,14 @@
                                        if (!Path.IsPathRooted (value))
                                                return;
 
-                                       if 
(Check_if_path_is_child_of_RootFolder (value)) {
-                                               SetSelectedPath 
(Path.GetFullPath (value));
+                                       try {
+                                               if 
(Check_if_path_is_child_of_RootFolder (value))
+                                                       SetSelectedPath 
(Path.GetFullPath (value));
+                                       } catch (Exception) {
+                                               // If we can't set the user's 
requested path, the
+                                               // best we can do is not crash 
and reset to the default
+                                               EndUpdate ();
+                                               RootFolder = rootFolder;
                                        }
                                }
                        }

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to