Skip to content

Commit ee718f3

Browse files
committed
AbstractConverter: do not require an ObjectService
We can fail gracefully if the ObjectService is not present.
1 parent c0307a2 commit ee718f3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/org/scijava/convert/AbstractConverter.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public abstract class AbstractConverter<I, O> extends
7272

7373
// -- Parameters --
7474

75-
@Parameter
75+
@Parameter(required = false)
7676
private ObjectService objectService;
7777

7878
// -- ConversionHandler methods --
@@ -131,6 +131,7 @@ public Object convert(final ConversionRequest request) {
131131

132132
@Override
133133
public void populateInputCandidates(final Collection<Object> objects) {
134+
if (objectService == null) return;
134135
for (final Object candidate : objectService.getObjects(getInputType())) {
135136
if (canConvert(candidate, getOutputType())) objects.add(candidate);
136137
}

0 commit comments

Comments
 (0)