summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpshi2012-03-12 04:45:24 (EDT)
committer mwu2012-03-12 04:45:24 (EDT)
commit4f0ac449783829fad5ed21ad1c66fd5e6a58115e (patch)
tree9bf8fdd52db80486d6aa6280e98d9169bedd6824
parentf4638803919926e19b465ae0654dcab0a67a8fda (diff)
downloadorg.eclipse.birt-4f0ac449783829fad5ed21ad1c66fd5e6a58115e.zip
org.eclipse.birt-4f0ac449783829fad5ed21ad1c66fd5e6a58115e.tar.gz
org.eclipse.birt-4f0ac449783829fad5ed21ad1c66fd5e6a58115e.tar.bz2
fix NPE when using a display name different from a data set type id
-rw-r--r--UI/org.eclipse.birt.report.designer.ui.data/src/org/eclipse/birt/report/designer/data/ui/dataset/DataSetBasePage.java17
1 files changed, 13 insertions, 4 deletions
diff --git a/UI/org.eclipse.birt.report.designer.ui.data/src/org/eclipse/birt/report/designer/data/ui/dataset/DataSetBasePage.java b/UI/org.eclipse.birt.report.designer.ui.data/src/org/eclipse/birt/report/designer/data/ui/dataset/DataSetBasePage.java
index 7b38eae..200dbeb 100644
--- a/UI/org.eclipse.birt.report.designer.ui.data/src/org/eclipse/birt/report/designer/data/ui/dataset/DataSetBasePage.java
+++ b/UI/org.eclipse.birt.report.designer.ui.data/src/org/eclipse/birt/report/designer/data/ui/dataset/DataSetBasePage.java
@@ -697,9 +697,12 @@ public class DataSetBasePage extends WizardPage
{
OdaDataSetTypeElement dElement = (OdaDataSetTypeElement) dataSetElement;
IConfigurationElement element = dElement.getIConfigurationElement( );
-
- AbstractDataSetWizard newWizard = (AbstractDataSetWizard) htDataSetWizards.get( element.getAttribute( "id" ) );//$NON-NLS-1$
- if ( newWizard == null )
+ AbstractDataSetWizard newWizard = null;
+ if ( element != null )
+ {
+ newWizard = (AbstractDataSetWizard) htDataSetWizards.get( element.getAttribute( "id" ) );//$NON-NLS-1$
+ }
+ if ( newWizard == null && element != null )
{
// Get the new wizard from this element
IConfigurationElement[] elements = element.getChildren( "newDataSetWizard" );//$NON-NLS-1$
@@ -920,11 +923,17 @@ public class DataSetBasePage extends WizardPage
DataSetType dataSetElement = (DataSetType) ( (Object[]) getSelectedDataSet( ) )[0];
dataSetTypeName = dataSetElement.getID( );
}
+ else if ( getSelectedDataSet( ) instanceof OdaDataSetTypeElement )
+ {
+ dataSetTypeName = ( (OdaDataSetTypeElement) getSelectedDataSet( ) ).getDataSetType( )
+ .getID( );
+ }
else if ( getSelectedDataSet( ) instanceof DataSetTypeElement )
{
dataSetTypeName = ( (DataSetTypeElement) getSelectedDataSet( ) ).getDataSetTypeName( );
}
-
+
+
return createDataSet( dataSetTypeName );
}