davidmoten / davidmoten/rxjava2-jdbc

defaultIfEmpty() possibly buggy...

Open
#18 3 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
Java
Stars
394
Forks
41
Avg merge
2m
Merged PRs (30d)
1

Description

Hello there!

I'm getting
`java.lang.RuntimeException: onNext called with null. Null values are generally not allowed in 2.x operators and sources.`
When the select doesn't have any retuned value (`null`), shouldn't it default to -1 instead of passing on `null`?
```
return database
.select("SELECT SUM(amount) FROM table")
.parameter("param1", param1)
.parameter("param2", param2)
.getAs(BigDecimal.class)
.defaultIfEmpty(new BigDecimal(-1));
```

Once again thank you thank you for your time!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.