Skip to content

Commit

Permalink
Check getBundle() returns non-null after PDE Manifest-editor opened
Browse files Browse the repository at this point in the history
Fixes #1374
  • Loading branch information
peddaiahjuturu authored and HannesWell committed Aug 15, 2024
1 parent 9b87c23 commit 70bc75c
Showing 1 changed file with 15 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -354,19 +354,22 @@ public void refresh() {
// Select the corresponding 'Bundle-Shape' radio button (eventually)
Stream.of(fBundleShapeDefault, fBundleShapeJar, fBundleShapeDir).forEach(b -> b.setSelection(false));
Button selectedBundleShape = fBundleShapeDefault;
IManifestHeader header = getBundle().getManifestHeader(ICoreConstants.ECLIPSE_BUNDLE_SHAPE);
if (header != null) {
String value = header.getValue();
if (value != null) {
selectedBundleShape = switch (value) {
case ICoreConstants.SHAPE_JAR -> fBundleShapeJar;
case ICoreConstants.SHAPE_DIR -> fBundleShapeDir;
default -> null; // unsupported value
};
IBundle bundle = getBundle();
if (bundle != null) {
IManifestHeader header = bundle.getManifestHeader(ICoreConstants.ECLIPSE_BUNDLE_SHAPE);
if (header != null) {
String value = header.getValue();
if (value != null) {
selectedBundleShape = switch (value) {
case ICoreConstants.SHAPE_JAR -> fBundleShapeJar;
case ICoreConstants.SHAPE_DIR -> fBundleShapeDir;
default -> null; // unsupported value
};
}
}
if (selectedBundleShape != null) {
selectedBundleShape.setSelection(true);
}
}
if (selectedBundleShape != null) {
selectedBundleShape.setSelection(true);
}
super.refresh();
}
Expand Down

0 comments on commit 70bc75c

Please sign in to comment.