Skip to content

Commit cd213d8

Browse files
committed
Fix for shape has no name
1 parent b0788b8 commit cd213d8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main/webapp/java/de/htwb/model/DatabaseRepository.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,10 @@ private void insertShapeIntoCache(String tableName, ImportedShape shape, String
365365
final String sql = String.format("INSERT INTO \""+SCHEME_CACHE+"\".\"%s\" (\"name\", \"validSince\", \"validUntil\", \"classId\", \"username\", \"geom\") VALUES(?, ?, ?, ?, ?, ?)", tableName);
366366
PreparedStatement ps = connection.prepareStatement(sql);
367367

368-
ps.setString(1, shape.getName());
368+
if (shape.getName() != null)
369+
ps.setString(1, shape.getName());
370+
else
371+
ps.setNull(1, Types.VARCHAR);
369372
if(shape.getValidSince() != null)
370373
ps.setDate(2, new java.sql.Date(shape.getValidSince().getTime()));
371374
else

0 commit comments

Comments
 (0)