jdk/src/share/classes/sun/swing/WindowsPlacesBar.java
changeset 454 2f4f4fef8880
parent 2 90ce3da70b43
child 715 f16baef3a20e
--- a/jdk/src/share/classes/sun/swing/WindowsPlacesBar.java	Mon Apr 28 17:17:45 2008 +0400
+++ b/jdk/src/share/classes/sun/swing/WindowsPlacesBar.java	Tue Apr 29 13:49:13 2008 +0400
@@ -93,11 +93,18 @@
             if (index >= 0 && index < folderName.length() - 1) {
                 folderName = folderName.substring(index + 1);
             }
-            Icon icon = null;
+            Icon icon;
             if (files[i] instanceof ShellFolder) {
                 // We want a large icon, fsv only gives us a small.
                 ShellFolder sf = (ShellFolder)files[i];
-                icon = new ImageIcon(sf.getIcon(true), sf.getFolderType());
+                Image image = sf.getIcon(true);
+
+                if (image == null) {
+                    // Get default image
+                    image = (Image) ShellFolder.get("shell32LargeIcon 1");
+                }
+
+                icon = image == null ? null : new ImageIcon(image, sf.getFolderType());
             } else {
                 icon = fsv.getSystemIcon(files[i]);
             }