summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorning.zhang2012-07-05 05:03:25 (EDT)
committer dgao2012-07-05 05:03:25 (EDT)
commit7ce3d23197e897f5e0cb555991c46407541fe86e (patch)
tree194592f02aee5d26b4ddcd873874b9e52a91b192
parentfe86b7f2798da678a6fe3287d17e1c611c0fe0b1 (diff)
downloadorg.eclipse.birt-7ce3d23197e897f5e0cb555991c46407541fe86e.zip
org.eclipse.birt-7ce3d23197e897f5e0cb555991c46407541fe86e.tar.gz
org.eclipse.birt-7ce3d23197e897f5e0cb555991c46407541fe86e.tar.bz2
Perform null checks.
-rw-r--r--xtab/org.eclipse.birt.report.item.crosstab.ui/src/org/eclipse/birt/report/item/crosstab/internal/ui/dialogs/CrosstabBindingDialogHelper.java20
1 files changed, 18 insertions, 2 deletions
diff --git a/xtab/org.eclipse.birt.report.item.crosstab.ui/src/org/eclipse/birt/report/item/crosstab/internal/ui/dialogs/CrosstabBindingDialogHelper.java b/xtab/org.eclipse.birt.report.item.crosstab.ui/src/org/eclipse/birt/report/item/crosstab/internal/ui/dialogs/CrosstabBindingDialogHelper.java
index 64118b4..1b53abb 100644
--- a/xtab/org.eclipse.birt.report.item.crosstab.ui/src/org/eclipse/birt/report/item/crosstab/internal/ui/dialogs/CrosstabBindingDialogHelper.java
+++ b/xtab/org.eclipse.birt.report.item.crosstab.ui/src/org/eclipse/birt/report/item/crosstab/internal/ui/dialogs/CrosstabBindingDialogHelper.java
@@ -531,6 +531,10 @@ public class CrosstabBindingDialogHelper extends AbstractBindingDialogHelper
{
boolean inUseDimsion = false;
CrosstabReportItemHandle crosstab = getCrosstabReportItemHandle( );
+ if(crosstab.getCube() == null)
+ {
+ return false;
+ }
int count = crosstab.getDimensionCount( ICrosstabConstants.COLUMN_AXIS_TYPE );
for ( int i = 0; i < count; i++ )
{
@@ -560,8 +564,12 @@ public class CrosstabBindingDialogHelper extends AbstractBindingDialogHelper
private void initCalculationTypeCombo( String dimensionName )
{
- DimensionHandle handle = getCrosstabReportItemHandle( ).getCube( )
- .getDimension( dimensionName );
+ CubeHandle cube = getCrosstabReportItemHandle( ).getCube( );
+ if (cube == null)
+ {
+ return;
+ }
+ DimensionHandle handle = cube.getDimension( dimensionName );
String cal = calculationType.getText( );
isStatic = true;
if ( recentButton.getSelection( ) )
@@ -1235,6 +1243,10 @@ public class CrosstabBindingDialogHelper extends AbstractBindingDialogHelper
private void initTimeDimension( )
{
String[] strs = getTimeDimensions( );
+ if (strs == null)
+ {
+ return;
+ }
timeDimension.setItems( strs );
if ( getBinding( ) == null )
@@ -1344,6 +1356,10 @@ public class CrosstabBindingDialogHelper extends AbstractBindingDialogHelper
CrosstabReportItemHandle crosstab = getCrosstabReportItemHandle( );
CubeHandle cube = crosstab.getCube( );
+ if(cube == null)
+ {
+ return null;
+ }
List list = cube.getPropertyHandle( ICubeModel.DIMENSIONS_PROP )
.getContents( );
for ( int i = 0; i < list.size( ); i++ )