Program: 66997
Project: 66997
Buggy source:
public Object onRowSets(IBaseResultSet[] baseResultSet) throws BirtException {
  if (cm == null) {
    return null;
  }
  IBaseResultSet resultSet=getDataToRender(baseResultSet);
  if (resultSet == null || !ChartItemUtil.checkChartBindingComplete(cm)) {
    return new Object[]{new byte[]{0}};
  }
  boolean bEmpty=false;
  if (ChartReportItemUtil.isEmpty(resultSet)) {
    if (isAutoHide()) {
      return null;
    }
    bEmpty=true;
  }
  Bounds bo=cm.getBlock().getBounds();
  if (bo.getWidth() == 0 && bo.getHeight() == 0 && (bo.isSetHeight() || bo.isSetWidth())) {
    return null;
  }
  try {
    if (rtc.getSharedScale() == null && ChartReportItemUtil.canScaleShared(modelHandle,cm)) {
      rtc.setSharedScale(createSharedScale(resultSet));
    }
    boolean isSharingQuery=false;
    if (modelHandle.getDataBindingReference() != null || modelHandle.getContainer() instanceof MultiViewsHandle || ChartItemUtil.isChartInheritGroups(modelHandle)) {
      isSharingQuery=true;
      isSharingQuery&=!ChartItemUtil.isChartHandle(ChartItemUtil.getReportItemReference(modelHandle));
    }
    rtc.setSharingQuery(isSharingQuery);
    BIRTExternalContext externalContext=new BIRTExternalContext(context);
    if (rtc.getScriptContext() != null && rtc.getScriptContext() instanceof ChartScriptContext) {
      ((ChartScriptContext)rtc.getScriptContext()).setExternalContext(externalContext);
    }
    initializeScriptHandler(externalContext);
    IDataRowExpressionEvaluator rowAdapter=createEvaluator(resultSet);
    IActionEvaluator evaluator=new BIRTActionEvaluator();
    updateChartModel();
    ChartReportStyleProcessor styleProcessor=new ChartReportStyleProcessor(modelHandle,true,this.style,this.dpi);
    styleProcessor.applyDefaultHyperlink(this.cm);
    if (!bindData(rowAdapter,evaluator) && isAutoHide()) {
      return null;
    }
    Object renderObject=generateRenderObject(rowAdapter,externalContext,bEmpty,styleProcessor);
    rowAdapter.close();
    return renderObject;
  }
 catch (  RuntimeException ex) {
    logger.log(ILogger.ERROR,Messages.getString("String_Node_Str"));
    logger.log(ex);
    throw new ChartException(ChartReportItemPlugin.ID,ChartException.GENERATION,ex);
  }
}

Fixed version (ground truth):
public Object onRowSets(IBaseResultSet[] baseResultSet) throws BirtException {
  if (cm == null) {
    return null;
  }
  IBaseResultSet resultSet=getDataToRender(baseResultSet);
  if (resultSet == null || !ChartItemUtil.checkChartBindingComplete(cm)) {
    return new Object[]{new byte[]{0}};
  }
  boolean bEmpty=false;
  if (ChartReportItemUtil.isEmpty(resultSet)) {
    if (isAutoHide()) {
      return null;
    }
    bEmpty=true;
  }
  Bounds bo=cm.getBlock().getBounds();
  if (bo.getWidth() == 0 && bo.getHeight() == 0 && (bo.isSetHeight() || bo.isSetWidth())) {
    return null;
  }
  try {
    if (rtc.getSharedScale() == null && ChartReportItemUtil.canScaleShared(modelHandle,cm)) {
      rtc.setSharedScale(createSharedScale(resultSet));
    }
    boolean isSharingQuery=false;
    if (modelHandle.getDataBindingReference() != null || modelHandle.getContainer() instanceof MultiViewsHandle || ChartItemUtil.isChartInheritGroups(modelHandle)) {
      isSharingQuery=true;
      isSharingQuery&=!ChartItemUtil.isChartHandle(ChartItemUtil.getReportItemReference(modelHandle));
    }
    rtc.setSharingQuery(isSharingQuery);
    BIRTExternalContext externalContext=new BIRTExternalContext(context);
    if (rtc.getScriptContext() != null && rtc.getScriptContext() instanceof ChartScriptContext) {
      ((ChartScriptContext)rtc.getScriptContext()).setExternalContext(externalContext);
    }
    initializeScriptHandler(externalContext);
    IDataRowExpressionEvaluator rowAdapter=createEvaluator(resultSet);
    IActionEvaluator evaluator=new BIRTActionEvaluator();
    ChartReportStyleProcessor styleProcessor=new ChartReportStyleProcessor(modelHandle,true,this.style,this.dpi);
    styleProcessor.applyDefaultHyperlink(this.cm);
    updateChartModel();
    if (!bindData(rowAdapter,evaluator) && isAutoHide()) {
      return null;
    }
    Object renderObject=generateRenderObject(rowAdapter,externalContext,bEmpty,styleProcessor);
    rowAdapter.close();
    return renderObject;
  }
 catch (  RuntimeException ex) {
    logger.log(ILogger.ERROR,Messages.getString("String_Node_Str"));
    logger.log(ex);
    throw new ChartException(ChartReportItemPlugin.ID,ChartException.GENERATION,ex);
  }
}