Skip to content

Commit 22ec1e2

Browse files
jonahgrahamHeikoKlare
authored andcommitted
Fix NPE when viewer control doesn't adapt to CompareConfiguration
Follow up to #2629 which introduced an NPE when doing refactor->rename in CDT: eclipse-cdt/cdt#1172
1 parent b141132 commit 22ec1e2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

bundles/org.eclipse.ltk.ui.refactoring/src/org/eclipse/ltk/internal/ui/refactoring/PreviewWizardPage.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,9 @@ private void showPreview(PreviewNode element) {
673673
if (container != null) {
674674
if (newViewer.getControl() instanceof IAdaptable adaptable) {
675675
CompareConfiguration config = adaptable.getAdapter(CompareConfiguration.class);
676-
config.setContainer(new WizardCompareContainer(container));
676+
if (config != null) {
677+
config.setContainer(new WizardCompareContainer(container));
678+
}
677679
}
678680
}
679681
} else {

0 commit comments

Comments
 (0)