more robust;
authorwenzelm
Wed, 03 May 2017 23:21:08 +0200
changeset 65704 aa9a7a753296
parent 65703 cead65c19f2e
child 65705 d0ca2a3ea657
more robust;
src/Pure/General/sql.scala
--- a/src/Pure/General/sql.scala	Wed May 03 23:04:25 2017 +0200
+++ b/src/Pure/General/sql.scala	Wed May 03 23:21:08 2017 +0200
@@ -428,7 +428,10 @@
       else stmt.setObject(i, OffsetDateTime.from(date.to_utc.rep))
 
     def date(rs: ResultSet, column: SQL.Column): Date =
-      Date.instant(rs.getObject(column.name, classOf[OffsetDateTime]).toInstant)
+    {
+      val obj = rs.getObject(column.name, classOf[OffsetDateTime])
+      if (obj == null) null else Date.instant(obj.toInstant)
+    }
 
     def insert_permissive(table: SQL.Table, sql: String = ""): String =
       table.insert_cmd("INSERT",