Author: rwhitcomb
Date: Fri Nov  9 18:43:20 2012
New Revision: 1407586

URL: http://svn.apache.org/viewvc?rev=1407586&view=rev
Log:
PIVOT-880: NPE when setting the root directory to a Windows UNC path
in a FileBrowserSheet.

Caused by the fact that the \\ doesn't match any items in the drive
list, and one of the listeners assumes the item will always be there.
Simple test for a non-null item fixes the issue and allows the UNC
path to be used, and to display items.

This is a merge of revision 1407585 from trunk to branches/2.0.x.

Modified:
    pivot/branches/2.0.x/   (props changed)
    
pivot/branches/2.0.x/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSkin.java

Propchange: pivot/branches/2.0.x/
------------------------------------------------------------------------------
  Merged /pivot/trunk:r1407585

Modified: 
pivot/branches/2.0.x/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSkin.java
URL: 
http://svn.apache.org/viewvc/pivot/branches/2.0.x/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSkin.java?rev=1407586&r1=1407585&r2=1407586&view=diff
==============================================================================
--- 
pivot/branches/2.0.x/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSkin.java
 (original)
+++ 
pivot/branches/2.0.x/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSkin.java
 Fri Nov  9 18:43:20 2012
@@ -711,7 +711,7 @@ public class TerraFileBrowserSkin extend
             public void selectedItemChanged(ListButton listButton, Object 
previousSelectedItem) {
                 if (previousSelectedItem != null) {
                     File drive = (File)listButton.getSelectedItem();
-                    if(drive.canRead()) {
+                    if(drive != null && drive.canRead()) {
                         fileBrowser.setRootDirectory(drive);
                     } else {
                         refreshRoots = true;


Reply via email to