mirror of
https://git.osgeo.org/gitea/postgis/postgis
synced 2024-10-24 00:52:40 +00:00
Fix possible null pointer exception if PostGIS is compiled without geos / proj support.
git-svn-id: http://svn.osgeo.org/postgis/trunk@1524 b70326c6-7e19-0410-871a-916f4a2858ee
This commit is contained in:
parent
c2853d9b69
commit
b467752be5
|
@ -124,8 +124,14 @@ public class VersionPrinter {
|
|||
public static String getVersionString(String function, Statement stat) {
|
||||
try {
|
||||
ResultSet rs = stat.executeQuery("SELECT " + function + "()");
|
||||
rs.next();
|
||||
return rs.getString(1).trim();
|
||||
if (rs.next()==false) {
|
||||
return "-- no result --";
|
||||
}
|
||||
String version = rs.getString(1);
|
||||
if (version==null) {
|
||||
return "-- null result --";
|
||||
}
|
||||
return version.trim();
|
||||
} catch (SQLException e) {
|
||||
return "-- unavailable -- ";
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue