Skip to content

Commit 8b4e96b

Browse files
Explicitly check a Context is set before allowing a custom ReLinker.
1 parent 137772e commit 8b4e96b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

objectbox-java/src/main/java/io/objectbox/BoxStoreBuilder.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,9 @@ public BoxStoreBuilder androidContext(Object context) {
200200
* on Android devices. Note that setting {@link #androidContext(Object)} is required for ReLinker to work.
201201
*/
202202
public BoxStoreBuilder androidReLinker(Object reLinkerInstance) {
203+
if (context == null) {
204+
throw new IllegalArgumentException("Set a Context using androidContext(context) first");
205+
}
203206
if (reLinkerInstance == null) {
204207
throw new NullPointerException("ReLinkerInstance may not be null");
205208
}

0 commit comments

Comments
 (0)