git4idea: NPE: GitUIUtil$1.getListCellRendererComponent
authorConstantine Plotnikov <Constantine.Plotnikov@jetbrains.com>
Wed, 23 Sep 2009 11:27:24 +0000 (15:27 +0400)
committerConstantine Plotnikov <Constantine.Plotnikov@jetbrains.com>
Wed, 23 Sep 2009 11:27:24 +0000 (15:27 +0400)
plugins/git4idea/src/git4idea/ui/GitUIUtil.java

index 73576bbcdd7ddc53dcb639d1d0243304b64e0ec3..b574ed833e862b96fea97cb1206aff93099e0c56 100644 (file)
@@ -60,7 +60,8 @@ public class GitUIUtil {
                                                     final int index,
                                                     final boolean isSelected,
                                                     final boolean cellHasFocus) {
-        String text = ((VirtualFile)value).getPresentableUrl();
+        VirtualFile file = (VirtualFile)value;
+        String text = file == null || !file.isValid() ? "(invalid)" : file.getPresentableUrl();
         return super.getListCellRendererComponent(list, text, index, isSelected, cellHasFocus);
       }
     };