diff --git a/realm/realm-library/src/objectServer/java/io/realm/mongodb/User.java b/realm/realm-library/src/objectServer/java/io/realm/mongodb/User.java index c49de02135..738988ee63 100644 --- a/realm/realm-library/src/objectServer/java/io/realm/mongodb/User.java +++ b/realm/realm-library/src/objectServer/java/io/realm/mongodb/User.java @@ -114,6 +114,9 @@ protected PushImpl(OsPush osPush) { } User(OsSyncUser osUser, App app) { + if (osUser == null) { + throw new IllegalStateException("Non-null user required."); + } this.osUser = osUser; this.app = app; this.profile = new UserProfile(this);