diff options
| author | Pierre-Charles David | 2017-03-17 08:20:14 +0000 |
|---|---|---|
| committer | Pierre-Charles David | 2017-04-06 09:24:49 +0000 |
| commit | bdacb9fd6965febe4c1e4cf2e0ff03d997562380 (patch) | |
| tree | c0390c2ae2493f94984be27806e46f230b4caf0b | |
| parent | fc375aebeed9dca037af91f2a5c8d7b5e00335d4 (diff) | |
| download | org.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.java | 24 |
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; } } |
