fixed computing of entities when the article does not have a description
[pnews.git] / war / src / main / java / pnews / servlet / ArticleProvider.java
index ba96fe3..bdba835 100644 (file)
@@ -117,10 +117,11 @@ public class ArticleProvider {
                 }
                                 
                 entities = new ArrayList<>();
-                if (desc != null && lang.equals("en"))
+                if (lang.equals("en"))
                         try {
                                 NER.classify(title, entities, config);
-                                NER.classify(desc, entities, config);
+                                if (desc != null)
+                                        NER.classify(desc, entities, config);
                         } catch (ClassCastException | ClassNotFoundException | IOException e1) {
                                 LOG.log(Level.SEVERE, "Cannot classify " + feedTitle, e1);                         
                         }