Skip to content

Conversation

DominicGBauer
Copy link
Contributor

Description

A null pointer exception is thrown when sync has not yet happened in updateHasSynced. When initially testing I was logged in and everything worked as expected but after deleting the app I ran into this issue.

Work Done

Added a try catch to catch the case when the cursor receives a null value in:

val timestamp = internalDb.getOptional("SELECT powersync_last_synced_at() as synced_at", null) { cursor ->
    cursor.getString(0)!!
}

@DominicGBauer DominicGBauer self-assigned this Sep 19, 2024
@DominicGBauer DominicGBauer merged commit 4523825 into main Sep 19, 2024
3 checks passed
@DominicGBauer DominicGBauer deleted the fix/null-pointer-in-update-has-synced branch September 19, 2024 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants