Skip to content

Commit f618bd1

Browse files
committed
Merge pull request #214 from gab1one/context-fix
Only try to load services if required.
2 parents 01547c6 + d2fecd2 commit f618bd1

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/main/java/org/scijava/Context.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,9 +272,11 @@ public Context(final Collection<Class<? extends Service>> serviceClasses,
272272

273273
setStrict(strict);
274274

275-
final ServiceHelper serviceHelper =
276-
new ServiceHelper(this, serviceClasses, strict);
277-
serviceHelper.loadServices();
275+
if (!serviceClasses.isEmpty()){
276+
final ServiceHelper serviceHelper =
277+
new ServiceHelper(this, serviceClasses, strict);
278+
serviceHelper.loadServices();
279+
}
278280
}
279281

280282
// -- Context methods --

0 commit comments

Comments
 (0)