Fixed seag fault
authorzev <zev@netxms.org>
Wed, 29 Nov 2017 15:27:06 +0000 (17:27 +0200)
committerzev <zev@netxms.org>
Wed, 29 Nov 2017 15:27:28 +0000 (17:27 +0200)
src/server/core/template.cpp

index 6fcba24..d7d7885 100644 (file)
@@ -860,7 +860,7 @@ DCObject *Template::getDCObjectByTemplateId(UINT32 tmplItemId, UINT32 userId)
                DCObject *curr = m_dcObjects->get(i);
       if (curr->getTemplateItemId() == tmplItemId)
                {
-         if (object->hasAccess(userId))
+         if (curr->hasAccess(userId))
             object = curr;
          else
             nxlog_debug_tag(_T("obj.dc"), 6, _T("Template::getDCObjectByTemplateId: denied access to DCObject %u for user %u"), object->getId(), userId);