handling the case where list of literals include nulls (this happens for date/time literals when the field is not filled in)
This commit is contained in:
parent
36a99486f6
commit
78607710de
1 changed files with 17 additions and 15 deletions
|
@ -156,6 +156,7 @@ public class AntiXssValidation implements N3ValidatorVTwo{
|
||||||
|
|
||||||
ArrayList errorMsgs = new ArrayList();
|
ArrayList errorMsgs = new ArrayList();
|
||||||
for( Literal literal : list ){
|
for( Literal literal : list ){
|
||||||
|
if(literal != null) {
|
||||||
CleanResults cr = antiSamy.scan(literal.getLexicalForm());
|
CleanResults cr = antiSamy.scan(literal.getLexicalForm());
|
||||||
errorMsgs.addAll( cr.getErrorMessages() );
|
errorMsgs.addAll( cr.getErrorMessages() );
|
||||||
|
|
||||||
|
@ -171,6 +172,7 @@ public class AntiXssValidation implements N3ValidatorVTwo{
|
||||||
errorMsgs.addAll( cr.getErrorMessages() );
|
errorMsgs.addAll( cr.getErrorMessages() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if( errorMsgs.isEmpty() )
|
if( errorMsgs.isEmpty() )
|
||||||
return null;
|
return null;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue