Revision: 9862
          
http://languagetool.svn.sourceforge.net/languagetool/?rev=9862&view=rev
Author:   dnaber
Date:     2013-04-02 19:45:10 +0000 (Tue, 02 Apr 2013)
Log Message:
-----------
avoid crash on null xmlHandler

Modified Paths:
--------------
    
trunk/languagetool/languagetool-wikipedia/src/main/java/org/languagetool/dev/wikipedia/CheckWikipediaDump.java

Modified: 
trunk/languagetool/languagetool-wikipedia/src/main/java/org/languagetool/dev/wikipedia/CheckWikipediaDump.java
===================================================================
--- 
trunk/languagetool/languagetool-wikipedia/src/main/java/org/languagetool/dev/wikipedia/CheckWikipediaDump.java
      2013-04-02 19:01:56 UTC (rev 9861)
+++ 
trunk/languagetool/languagetool-wikipedia/src/main/java/org/languagetool/dev/wikipedia/CheckWikipediaDump.java
      2013-04-02 19:45:10 UTC (rev 9862)
@@ -137,10 +137,12 @@
     } catch (ArticleLimitReachedException e) {
       System.out.println(e);
     } finally {
-      if (xmlHandler != null) { xmlHandler.close(); }
-      final float matchesPerDoc = (float)xmlHandler.getRuleMatchCount() / 
xmlHandler.getArticleCount();
-      System.out.printf(lang + ": %d total matches\n", 
xmlHandler.getRuleMatchCount());
-      System.out.printf(lang + ": ø%.2f rule matches per document\n", 
matchesPerDoc);
+      if (xmlHandler != null) {
+        final float matchesPerDoc = (float)xmlHandler.getRuleMatchCount() / 
xmlHandler.getArticleCount();
+        System.out.printf(lang + ": %d total matches\n", 
xmlHandler.getRuleMatchCount());
+        System.out.printf(lang + ": ø%.2f rule matches per document\n", 
matchesPerDoc);
+        xmlHandler.close();
+      }
     }
   }
 

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire 
the most talented Cisco Certified professionals. Visit the 
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html
_______________________________________________
Languagetool-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/languagetool-commits

Reply via email to