Skip to content

Commit

Permalink
Fixed two NPE sources and removed output to STDOUT
Browse files Browse the repository at this point in the history
  • Loading branch information
egonw committed Jul 25, 2011
1 parent 7452a79 commit 42aa892
Showing 1 changed file with 5 additions and 3 deletions.
Expand Up @@ -38,7 +38,8 @@ public Object getDestination( Object rel ) {
return (Literal)resource;
if (resource.isResource()) {
Resource res = (Resource)resource;
if (!res.getURI().startsWith("http://www.w3.org/"))
if (res.getURI() != null &&
!res.getURI().startsWith("http://www.w3.org/"))
return resource;
}
return ((Statement)rel).getObject();
Expand All @@ -52,10 +53,11 @@ public Object[] getElements( Object input ) {
while (iter.hasNext()) {
Statement stmt = iter.next();
Resource subject = stmt.getSubject();
if (!subject.getURI().startsWith("http://www.w3.org/"))
if (subject.getURI() != null &&
!subject.getURI().startsWith("http://www.w3.org/"))
elements.add(stmt);
}
System.out.println(elements);
// System.out.println(elements);
return elements.toArray();
}

Expand Down

0 comments on commit 42aa892

Please sign in to comment.