Anybody know why I would be getting this exception...
# room
c
Anybody know why I would be getting this exception when querying Room soon after app startup, but no exception when querying Room after the app has been running for more than a few seconds?
Copy code
java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.Boolean.booleanValue()' on a null object reference
Here is my query:
Copy code
@Query("SELECT isCompleted FROM $ONBOARDING_STATUS_TABLE_NAME WHERE type = :featureEducationType")
suspend fun isCompleted(featureEducationType: FeatureEducationType): Boolean
I'm not sure how the query is returning null, because the column is defined with a default value:
Copy code
@Entity(tableName = "table_onboarding_status")
data class OnboardingStatus(
    @ColumnInfo(name = "type") @PrimaryKey val type: FeatureEducationType,
    @ColumnInfo(name = "isCompleted", defaultValue = "0") val isCompleted: Boolean,
)