fixed server crash if DCI queued for cache loading was deleted
authorVictor Kirhenshtein <victor@netxms.org>
Wed, 13 Sep 2017 09:48:36 +0000 (12:48 +0300)
committerVictor Kirhenshtein <victor@netxms.org>
Wed, 13 Sep 2017 09:48:58 +0000 (12:48 +0300)
src/server/core/datacoll.cpp

index cf51606..ecfd3d3 100644 (file)
@@ -504,7 +504,7 @@ THREAD_RESULT THREAD_CALL CacheLoader(void *arg)
       {
          object->incRefCount();
          DCObject *dci = static_cast<DataCollectionTarget*>(object)->getDCObjectById(ref->getId(), true);
-         if (dci->getType() == DCO_TYPE_ITEM)
+         if ((dci != NULL) && (dci->getType() == DCO_TYPE_ITEM))
          {
             DbgPrintf(6, _T("Loading cache for DCI %s [%d] on %s [%d]"),
                       ref->getName(), ref->getId(), object->getName(), object->getId());