Skip to content

Commit

Permalink
FIX NPE when a series with no observations exist, the next values che…
Browse files Browse the repository at this point in the history
…ck fails because the session is closed
  • Loading branch information
Carsten Hollmann committed May 16, 2019
1 parent 653827e commit 208bff0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
### Fixed issues

- Cache update of result templates with dynamic feattureOfInterest definition
- NPE when a series with no observations exist, the next values check fails because the session is closed

## Release 52n-sensorweb-sos-4.4.6

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public HibernateChunkStreamingValue(GetObservationRequest request, long procedur
@Override
public boolean hasNextValue() throws OwsExceptionReport {
boolean next = false;
if (valuesResult == null || !valuesResult.hasNext()) {
if ((valuesResult == null || !valuesResult.hasNext()) && getSession().isOpen()) {
if (!noChunk) {
getNextResults();
if (chunkSize <= 0 || (valueCounter != 0 && valueCounter < chunkSize)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public HibernateChunkSeriesStreamingValue(AbstractObservationRequest request, lo
@Override
public boolean hasNextValue() throws OwsExceptionReport {
boolean next = false;
if (seriesValuesResult == null || !seriesValuesResult.hasNext()) {
if ((seriesValuesResult == null || !seriesValuesResult.hasNext()) && getSession().isOpen()) {
if (!noChunk && (valueCounter == 0 || valueCounter == chunkSize)) {
getNextResults();
if (chunkSize <= 0 || (valueCounter != 0 && valueCounter < chunkSize)) {
Expand Down

0 comments on commit 208bff0

Please sign in to comment.