-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RealmLog causes IllegalStateException #3928
Comments
While this is clearly a bug, what's the point of using |
This is more a proof of concept than anything. |
Well that is embarrassing. Thanks for the report. |
Any progress on this? Still occurring. |
We should fix this asap, but might want to verify if it is still happening on #3834 |
It doesn't look like there's a snapshot available for the changes you're making in #3834. |
Since #3834 is still reviewing, the snapshot doesn't include it yet. |
#3834 is merged to master. will be fixed in |
Steps
Desired behavior
The boolean checks return true or false and I go about my day.
Encountered behavior
In the case of isValid being false, RealmLog attempts to write this event and calls toString() on the Realm proxy class. This causes an IllegalStateException with the message: Can't access a row that hasn't been loaded or represents 'null', make sure the instance is loaded and is valid by calling 'RealmObject.isLoaded() && RealmObject.isValid()'.
StackTrace
FATAL EXCEPTION: main Process: org.unos.transnet.release, PID: 12048 java.lang.IllegalStateException: Can't access a row that hasn't been loaded or represents 'null', make sure the instance is loaded and is valid by calling 'RealmObject.isLoaded() && RealmObject.isValid()'. at io.realm.internal.Row$1.isNullLink(Row.java:191) at io.realm.ProfileEntityRealmProxy.realmGet$user(ProfileEntityRealmProxy.java:100) at org.unos.ett.api.entity.ProfileEntity.toString(ProfileEntity.java:31) at java.util.Formatter.transform(Formatter.java:1421) at java.util.Formatter.doFormat(Formatter.java:1081) at java.util.Formatter.format(Formatter.java:1042) at java.util.Formatter.format(Formatter.java:1011) at java.lang.String.format(String.java:1554) at java.lang.String.format(String.java:1528) at io.realm.log.RealmLog.log(RealmLog.java:360) at io.realm.log.RealmLog.trace(RealmLog.java:203) at io.realm.log.RealmLog.trace(RealmLog.java:192) at io.realm.HandlerController.completedAsyncRealmObject(HandlerController.java:636) at io.realm.HandlerController.handleMessage(HandlerController.java:131) at android.os.Handler.dispatchMessage(Handler.java:98) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5417) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Code Sample
Version of Realm and tooling
Realm version(s): 2.1.1
Realm sync feature enabled: no
Android Studio version: 2.2.3
Which Android version and device: Android Emulator, API 23
The text was updated successfully, but these errors were encountered: