[jsword-svn] r1415 - trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book

dmsmith at www.crosswire.org dmsmith at www.crosswire.org
Mon Jun 18 15:08:39 MST 2007


Author: dmsmith
Date: 2007-06-18 15:08:38 -0700 (Mon, 18 Jun 2007)
New Revision: 1415

Modified:
   trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/DisplaySelectPane.java
   trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/ParallelBookPicker.java
Log:
Fixed a bug when no Bibles are installed.

Modified: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/DisplaySelectPane.java
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/DisplaySelectPane.java	2007-06-18 22:07:52 UTC (rev 1414)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/DisplaySelectPane.java	2007-06-18 22:08:38 UTC (rev 1415)
@@ -563,7 +563,7 @@
      */
     /*private*/ final void enableComponents()
     {
-        boolean readable = selected != null;
+        boolean readable = selected != null && selected.length > 0;
         boolean searchable = readable && selected[0].getIndexStatus().equals(IndexStatus.DONE);
         boolean indexable = readable && selected[0].getIndexStatus().equals(IndexStatus.UNDONE);
 

Modified: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/ParallelBookPicker.java
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/ParallelBookPicker.java	2007-06-18 22:07:52 UTC (rev 1414)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/ParallelBookPicker.java	2007-06-18 22:08:38 UTC (rev 1415)
@@ -137,7 +137,11 @@
             if (comp instanceof JComboBox)
             {
                 JComboBox combo = (JComboBox) comp;
-                books.add(combo.getSelectedItem());
+                Object book = combo.getSelectedItem();
+                if (book != null)
+                {
+                    books.add(book);
+                }
             }
         }
         return (Book[]) books.toArray(new Book[books.size()]);




More information about the jsword-svn mailing list