Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre-Charles David2017-03-17 08:20:14 +0000
committerPierre-Charles David2017-04-06 09:24:49 +0000
commitbdacb9fd6965febe4c1e4cf2e0ff03d997562380 (patch)
treec0390c2ae2493f94984be27806e46f230b4caf0b
parentfc375aebeed9dca037af91f2a5c8d7b5e00335d4 (diff)
downloadorg.eclipse.sirius-bdacb9fd6965febe4c1e4cf2e0ff03d997562380.tar.gz
org.eclipse.sirius-bdacb9fd6965febe4c1e4cf2e0ff03d997562380.tar.xz
org.eclipse.sirius-bdacb9fd6965febe4c1e4cf2e0ff03d997562380.zip
[500681] Fix more potential NPEs in the automated migration
Bug: 500681 Change-Id: I577fade340b17b505c6ab72e3ffbf4bb6f190bb4 Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>
-rw-r--r--plugins/org.eclipse.sirius.ui.properties/src/org/eclipse/sirius/ui/properties/internal/migration/ReferenceWidgetMigrationParticipant.java24
1 files changed, 14 insertions, 10 deletions
diff --git a/plugins/org.eclipse.sirius.ui.properties/src/org/eclipse/sirius/ui/properties/internal/migration/ReferenceWidgetMigrationParticipant.java b/plugins/org.eclipse.sirius.ui.properties/src/org/eclipse/sirius/ui/properties/internal/migration/ReferenceWidgetMigrationParticipant.java
index 9535c7be0d..520525ca9f 100644
--- a/plugins/org.eclipse.sirius.ui.properties/src/org/eclipse/sirius/ui/properties/internal/migration/ReferenceWidgetMigrationParticipant.java
+++ b/plugins/org.eclipse.sirius.ui.properties/src/org/eclipse/sirius/ui/properties/internal/migration/ReferenceWidgetMigrationParticipant.java
@@ -238,11 +238,13 @@ public class ReferenceWidgetMigrationParticipant extends AbstractVSMMigrationPar
*/
private HyperlinkWidgetStyle handleHyperlinkStyle(ListWidgetStyle listWidgetStyle) {
HyperlinkWidgetStyle hyperlinkWidgetStyle = PropertiesFactory.eINSTANCE.createHyperlinkWidgetStyle();
- hyperlinkWidgetStyle.setLabelBackgroundColor(listWidgetStyle.getLabelBackgroundColor());
- hyperlinkWidgetStyle.setLabelForegroundColor(listWidgetStyle.getLabelForegroundColor());
- hyperlinkWidgetStyle.setLabelFontNameExpression(listWidgetStyle.getLabelFontNameExpression());
- hyperlinkWidgetStyle.setLabelFontSizeExpression(listWidgetStyle.getLabelFontSizeExpression());
- hyperlinkWidgetStyle.getLabelFontFormat().addAll(listWidgetStyle.getLabelFontFormat());
+ if (listWidgetStyle != null) {
+ hyperlinkWidgetStyle.setLabelBackgroundColor(listWidgetStyle.getLabelBackgroundColor());
+ hyperlinkWidgetStyle.setLabelForegroundColor(listWidgetStyle.getLabelForegroundColor());
+ hyperlinkWidgetStyle.setLabelFontNameExpression(listWidgetStyle.getLabelFontNameExpression());
+ hyperlinkWidgetStyle.setLabelFontSizeExpression(listWidgetStyle.getLabelFontSizeExpression());
+ hyperlinkWidgetStyle.getLabelFontFormat().addAll(listWidgetStyle.getLabelFontFormat());
+ }
return hyperlinkWidgetStyle;
}
@@ -285,11 +287,13 @@ public class ReferenceWidgetMigrationParticipant extends AbstractVSMMigrationPar
*/
private LabelWidgetStyle handleLabelStyle(ListWidgetStyle listWidgetStyle) {
LabelWidgetStyle labelWidgetStyle = PropertiesFactory.eINSTANCE.createLabelWidgetStyle();
- labelWidgetStyle.setLabelBackgroundColor(listWidgetStyle.getLabelBackgroundColor());
- labelWidgetStyle.setLabelForegroundColor(listWidgetStyle.getLabelForegroundColor());
- labelWidgetStyle.setLabelFontNameExpression(listWidgetStyle.getLabelFontNameExpression());
- labelWidgetStyle.setLabelFontSizeExpression(listWidgetStyle.getLabelFontSizeExpression());
- labelWidgetStyle.getLabelFontFormat().addAll(listWidgetStyle.getLabelFontFormat());
+ if (listWidgetStyle != null) {
+ labelWidgetStyle.setLabelBackgroundColor(listWidgetStyle.getLabelBackgroundColor());
+ labelWidgetStyle.setLabelForegroundColor(listWidgetStyle.getLabelForegroundColor());
+ labelWidgetStyle.setLabelFontNameExpression(listWidgetStyle.getLabelFontNameExpression());
+ labelWidgetStyle.setLabelFontSizeExpression(listWidgetStyle.getLabelFontSizeExpression());
+ labelWidgetStyle.getLabelFontFormat().addAll(listWidgetStyle.getLabelFontFormat());
+ }
return labelWidgetStyle;
}
}

Back to the top