Skip to content

Commit

Permalink
Merge pull request #6382 from bndtools/issue/6380-NPE-on-resolve
Browse files Browse the repository at this point in the history
NPE in Resolve when running without project
  • Loading branch information
pkriens authored Dec 2, 2024
2 parents abad56e + a2d36c5 commit b308e38
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion biz.aQute.bndlib/src/aQute/bnd/osgi/package-info.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@Version("7.2.0")
@Version("7.3.0")
package aQute.bnd.osgi;

import org.osgi.annotation.versioning.Version;
11 changes: 7 additions & 4 deletions bndtools.core/src/bndtools/editor/BndEditor.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
import aQute.bnd.help.instructions.ResolutionInstructions.ResolveMode;
import aQute.bnd.osgi.Processor;
import aQute.bnd.properties.BadLocationException;
import biz.aQute.resolve.Bndrun;
import bndtools.Plugin;
import bndtools.central.Central;
import bndtools.editor.common.IPriority;
Expand Down Expand Up @@ -617,10 +618,12 @@ private Promise<Workspace> loadEditModel(File inputFile, BndEditModel model) thr

Processor p = workspace.readLocked(() -> workspace.findProcessor(inputFile)
.orElseGet(() -> {
Processor dummy = new Processor();
dummy.setBase(inputFile.getParentFile());
dummy.setPropertiesFile(inputFile);
return dummy;
try {
Bndrun bndrun = Bndrun.createBndrun(workspace, inputFile);
return bndrun;
} catch (Exception e) {
throw Exceptions.duck(e);
}
}));
model.setWorkspace(workspace);
model.setOwner(p);
Expand Down

0 comments on commit b308e38

Please sign in to comment.