Bug 155262 Total.countDistinct() method returns null on empty resultset
If you use Total.countDistinct(row.aColumn, null, 0) or Total.countDistinct(dataSetRow.aColumn, null, 0) and the resultset for the dataset is empty, the method returns null. It should return 0.
data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/impl/aggregation/JSAggrValueObject.java
public Object get( int index, Scriptable start )
	{
		if ( index < 0 || index >= this.aggrCount )
		{
			
			return null;
		}
		try
		{
			return getAggregateValue( index );
		}
		catch ( DataException e )
		{
			throw Context.reportRuntimeError( e.getLocalizedMessage( ) );
		}
	}
	
	/**
	 * Get the aggregate value
	 * @param aggrIndex
	 * @return
	 * @throws DataException
	 */
	private Object getAggregateValue( int aggrIndex ) throws DataException
	{
		AggrExprInfo aggrInfo = getAggrInfo( aggrIndex );
				
		if ( this.odiResult.getRowCount( ) == 0 )
		{
			if ( aggrInfo.aggregation.getName( ).equalsIgnoreCase( "COUNT" ) )