changeset 573:523241efee57 find-refactoring

fix
author Alain Mazy <am@orthanc.team>
date Fri, 27 Sep 2024 14:38:40 +0200
parents 6667bd31beaf
children 58fce5aebb31
files PostgreSQL/Plugins/PostgreSQLIndex.cpp
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/PostgreSQL/Plugins/PostgreSQLIndex.cpp	Thu Sep 26 17:24:29 2024 +0200
+++ b/PostgreSQL/Plugins/PostgreSQLIndex.cpp	Fri Sep 27 14:38:40 2024 +0200
@@ -257,7 +257,14 @@
 
       statement.Execute();
 
-      result = static_cast<uint64_t>(statement.ReadInteger64(0));
+      if (statement.IsNull(0))
+      {
+        return 0;
+      }
+      else
+      {
+        result = static_cast<uint64_t>(statement.ReadInteger64(0));
+      }
     }
     
     // disabled because this is not alway true while transactions are being executed in READ COMITTED TRANSACTION.  This is however true when no files are being delete/added