-
Notifications
You must be signed in to change notification settings - Fork 22
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
Response.take(Class<T>, int)
throws a NullPointerException
if the query returns no results
#108
Comments
Response.take(Class<T>, int)
throws a NullPointerException
if the query returns no results instead of returning null or an empty instance. This makes error handling more difficult in cases where no matching entry existsResponse.take(Class<T>, int)
throws a NullPointerException
if the query returns no results
I’m still experiencing the Debugging steps:
`public static CompletableFuture findById(Long userId) {
} `
`public class AyaseUser {
}`
Should I check |
Bad formatted sorry about that. 😃 |
same here |
Would it be possible to handle this case more gracefully by returning
null
or an empty object instead of throwing an exception?Here is my stack trace when this issue occurs:
java.lang.NullPointerException: Object instance not found at com.surrealdb.Value.getObject(Native Method) at com.surrealdb.Value.getObject(Value.java:109) at com.surrealdb.ValueClassConverter.convert(ValueClassConverter.java:175) at com.surrealdb.Value.get(Value.java:212) at dev.massi.ayase.database.model.AyaseUser.lambda$findById$0(AyaseUser.java:74)
Originally posted by @massikhr in #106 (comment)
The text was updated successfully, but these errors were encountered: