diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/LauncherSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/LauncherSection.java index 3cf6c7a45a..23689efad5 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/LauncherSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/LauncherSection.java @@ -419,7 +419,10 @@ public MacBundleUrlTypesComposite(Composite comp, FormToolkit toolkit) { fBundleUrlTypesTable.setLabelProvider(new LabelProvider()); fBundleUrlTypesTable.setContentProvider((IStructuredContentProvider) inputElement -> { if (inputElement instanceof IProduct product) { - return product.getLauncherInfo().getMacBundleUrlTypes().toArray(); + ILauncherInfo launcherInfo = product.getLauncherInfo(); + if (launcherInfo != null) { + return launcherInfo.getMacBundleUrlTypes().toArray(); + } } return new Object[0]; }); @@ -477,14 +480,14 @@ private void openBundleURLTypeDialog(IMacBundleUrlType propertyToEdit, Set getExistingBundleUrlTypes() { - return new HashSet<>(getProduct().getLauncherInfo().getMacBundleUrlTypes()); + return new HashSet<>(getLauncherInfo().getMacBundleUrlTypes()); } private void handleRemove() { IStructuredSelection ssel = fBundleUrlTypesTable.getStructuredSelection(); if (!ssel.isEmpty()) { List bundleUrlTypes = ssel.toList(); - getProduct().getLauncherInfo().removeMacBundleUrlTypes(bundleUrlTypes); + getLauncherInfo().removeMacBundleUrlTypes(bundleUrlTypes); fBundleUrlTypesTable.refresh(false); } } @@ -554,13 +557,13 @@ protected void validate() { @Override protected void okPressed() { if (fEdit != null) { - getProduct().getLauncherInfo().removeMacBundleUrlTypes(List.of(fEdit)); + getLauncherInfo().removeMacBundleUrlTypes(List.of(fEdit)); } IProductModelFactory factory = getModel().getFactory(); fEdit = factory.createMacBundleUrlType(); fEdit.setScheme(fScheme.getText().trim()); fEdit.setName(fName.getText().trim()); - getProduct().getLauncherInfo().addMacBundleUrlTypes(List.of(fEdit)); + getLauncherInfo().addMacBundleUrlTypes(List.of(fEdit)); super.okPressed(); }