gvSIG bugs #2088
NPE drawing an empty Postgis Layer
Status: | Closed | % Done: | 0% | |
---|---|---|---|---|
Priority: | Normal | Spent time: | - | |
Assignee: | Juan Lucas Domínguez | |||
Category: | Database | |||
Target version: | 2.1.0-2217-devel | |||
Severity: | Add-on version: | 2.0 | ||
gvSIG version: | 2.0.0 | Add-on build: | 2066 | |
gvSIG build: | 2066 | Add-on resolve version: | ||
Operative System: | Add-on resolve build: | |||
Keywords: | Proyecto: | |||
Has patch: | No | Hito: | ||
Add-on name: | Database conectors (org.gvsig.geodb) |
Description
When I tried to add a empty layer (0 register layer, due filter or no-records in table/view) a NPE exception is throw:
java.lang.NullPointerException at org.gvsig.symbology.fmap.mapcontext.rendering.legend.impl.AbstractVectorialLegend.internalDraw(AbstractVectorialLegend.java:342) at org.gvsig.symbology.fmap.mapcontext.rendering.legend.impl.AbstractVectorialLegend.draw(AbstractVectorialLegend.java:296) at org.gvsig.symbology.fmap.mapcontext.rendering.legend.impl.AbstractVectorialLegend.draw(AbstractVectorialLegend.java:141) at org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect.draw(FLyrVect.java:308) .... ....
This is due to PostgreSQLHelper.getFullEnvelopeOfField() method returns null
if no-record or null
is found as result of Select asbinary(extent({field}))
execution.
Suggestions:
1. PostgreSQLHelper.getFullEnvelopeOfField
always returns a Envelope. If can't get any an empty-envelope instance will be returned.
2. AbstractVectorialLegend.internalDraw
checks if layer returns null
.
History
#1 Updated by Juan Lucas Domínguez over 10 years ago
- Assignee set to Juan Lucas Domínguez
- Target version set to 2.1.0-2223-rc1
#2 Updated by Juan Lucas Domínguez over 10 years ago
- Status changed from New to Fixed
Prevented null in value returned by method as suggested by jmvivo.
#3 Updated by Joaquín del Cerro Murciano over 10 years ago
- Target version changed from 2.1.0-2223-rc1 to 2.1.0-2217-devel
#4 Updated by Álvaro Anguix over 10 years ago
- Status changed from Fixed to Closed