much quicker BooksPanel display, set max title size for BookBlocks
[fanfix.git] / src / be / nikiroo / fanfix_swing / gui / book / BookInfo.java
index bde9abbc34b547f4598f88bf4eb77a090c453cf2..713ee203564f8ab90af62335e178faebb43fde1b 100644 (file)
@@ -261,9 +261,11 @@ public class BookInfo {
                                "source_" + (source == null ? "" : source), source);
 
                int size = 0;
-               try {
-                       size = lib.getList().filter(source, null, null).size();
-               } catch (IOException e) {
+               if (lib != null) {
+                       try {
+                               size = lib.getList().filter(source, null, null).size();
+                       } catch (IOException e) {
+                       }
                }
 
                info.count = StringUtils.formatNumber(size);
@@ -292,9 +294,11 @@ public class BookInfo {
                                "author_" + (author == null ? "" : author), author);
 
                int size = 0;
-               try {
-                       size = lib.getList().filter(null, author, null).size();
-               } catch (IOException e) {
+               if (lib != null) {
+                       try {
+                               size = lib.getList().filter(null, author, null).size();
+                       } catch (IOException e) {
+                       }
                }
 
                info.count = StringUtils.formatNumber(size);