Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/utils/TableHelper.java17
1 files changed, 10 insertions, 7 deletions
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/utils/TableHelper.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/utils/TableHelper.java
index f6b0297f19a..d1fc49c6271 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/utils/TableHelper.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/utils/TableHelper.java
@@ -132,14 +132,17 @@ public class TableHelper {
* the display style to use for the table, the return value is never <code>null</code>
*/
public static final DisplayStyle getTableDisplayStyle(final Table table) {
- TableDisplayStyle displayStyle = (TableDisplayStyle) table.getStyle(NattablestylePackage.eINSTANCE.getTableDisplayStyle());
- if (displayStyle == null) {
- displayStyle = (TableDisplayStyle) table.getTableConfiguration().getStyle(NattablestylePackage.eINSTANCE.getTableDisplayStyle());
- }
- if (displayStyle != null) {
- return displayStyle.getDisplayStyle();
+ DisplayStyle result = DisplayStyle.NORMAL;
+ if (null != table) {
+ TableDisplayStyle displayStyle = (TableDisplayStyle) table.getStyle(NattablestylePackage.eINSTANCE.getTableDisplayStyle());
+ if (null == displayStyle && null != table.getTableConfiguration()) {
+ displayStyle = (TableDisplayStyle) table.getTableConfiguration().getStyle(NattablestylePackage.eINSTANCE.getTableDisplayStyle());
+ }
+ if (displayStyle != null) {
+ result = displayStyle.getDisplayStyle();
+ }
}
- return DisplayStyle.NORMAL;
+ return result;
}

Back to the top