Project: Birt
Bug 286775 NullPointerException in ReportItemExecutor (code snippet enclosed)
Reported: 2009-08-17 05:18:32 | Status: verified fixed

Build ID: 20090619-0625 Steps To Reproduce: Using an invalid javascript expression as visibility condition for a list throw a NPE instead of reporting the expression evaluation error. More information: I have checked out the source of birt engine 2.5.0 (tag BIRT_2_5_0_Release_200906170630), and in ReportItemExecutor line 477, it appears that a reference hasn't been checked correctly. snippet : === ReportItemExecutor line 468 == VisibilityRuleDesign rule = visibility.getRule( i ); Expression expr = rule.getExpression( ); Boolean result = evaluateBoolean( expr ); if ( result == null ) <--- reference check { context.addException( new EngineException( MessageConstants.EXPRESSION_EVALUATION_ERROR, rule.getExpression( ) ) ); } boolean isHidden = result.booleanValue( ); <-- unckecked access, NPE thrown === End ===

Files changed in fix:
engine/org.eclipse.birt.report.engine/src/org/eclipse/birt/report/engine/executor/ReportItemExecutor.java