You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ctakes.apache.org by sh...@apache.org on 2013/07/01 23:15:08 UTC

svn commit: r1498691 - /ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/attributes/subject/SubjectAttributeClassifier.java

Author: shalgrim
Date: Mon Jul  1 21:15:08 2013
New Revision: 1498691

URL: http://svn.apache.org/r1498691
Log:
fixing a null pointer exception

Modified:
    ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/attributes/subject/SubjectAttributeClassifier.java

Modified: ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/attributes/subject/SubjectAttributeClassifier.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/attributes/subject/SubjectAttributeClassifier.java?rev=1498691&r1=1498690&r2=1498691&view=diff
==============================================================================
--- ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/attributes/subject/SubjectAttributeClassifier.java (original)
+++ ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/attributes/subject/SubjectAttributeClassifier.java Mon Jul  1 21:15:08 2013
@@ -186,9 +186,13 @@ public class SubjectAttributeClassifier 
 				// check if there are one-removed dependencies on the dependency path
 				DependencyPath path = DependencyUtility.getPath(jCas, DependencyUtility.getNominalHeadNode(jCas,tok), 
 						DependencyUtility.getNominalHeadNode(jCas,mention));
-				int commonInd = path.indexOf(path.getCommonNode());
-				if (commonInd==1 || commonInd==path.size()-2) {
-					vfeat.put(FAMILY_DEPTOK, true);
+				
+				// 6/28/13 srh fixing for null pointer exception
+				if (path != null) {
+					int commonInd = path.indexOf(path.getCommonNode());
+					if (commonInd==1 || commonInd==path.size()-2) {
+						vfeat.put(FAMILY_DEPTOK, true);
+					}
 				}
 			}