Selaa lähdekoodia

historydatabackend_memory: Fix lastIndex function.

Peter Rustler 5 vuotta sitten
vanhempi
commit
7187811ab4
1 muutettua tiedostoa jossa 2 lisäystä ja 0 poistoa
  1. 2 0
      plugins/historydata/ua_historydatabackend_memory.c

+ 2 - 0
plugins/historydata/ua_historydatabackend_memory.c

@@ -251,6 +251,8 @@ lastIndex_backend_memory(UA_Server *server,
                          void *sessionContext,
                          const UA_NodeId * nodeId) {
     const UA_NodeIdStoreContextItem_backend_memory* item = getNodeIdStoreContextItem_backend_memory((UA_MemoryStoreContext*)context, server, nodeId);;
+    if (item->storeEnd == 0)
+        return 0;
     return item->storeEnd - 1;
 }