Skip to content
This repository was archived by the owner on Jul 18, 2023. It is now read-only.

Commit 51b0aba

Browse files
authored
Merge pull request #221 from mtconnect/monitor_file_change_device_issues
2 parents ee784c8 + df3a17c commit 51b0aba

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ set(AGENT_VERSION_MAJOR 2)
33
set(AGENT_VERSION_MINOR 0)
44
set(AGENT_VERSION_PATCH 0)
55
set(AGENT_VERSION_BUILD 12)
6-
set(AGENT_VERSION_RC "_RC20")
6+
set(AGENT_VERSION_RC "_RC21")
77

88
# This minimum version is to support Visual Studio 2017 and C++ feature checking and FetchContent
99
cmake_minimum_required(VERSION 3.16 FATAL_ERROR)

src/agent.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,8 +389,11 @@ namespace mtconnect {
389389
if (version)
390390
versionDeviceXml();
391391

392-
auto d = m_agentDevice->getDeviceDataItem("device_changed");
393-
m_loopback->receive(d, *uuid);
392+
if (m_agentDevice)
393+
{
394+
auto d = m_agentDevice->getDeviceDataItem("device_changed");
395+
m_loopback->receive(d, *uuid);
396+
}
394397

395398
return true;
396399
}

src/device_model/data_item/data_item.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,18 @@ namespace mtconnect {
250250
bool DataItem::operator<(const DataItem &another) const
251251
{
252252
auto component = m_component.lock();
253+
if (component == nullptr)
254+
return true;
255+
auto dev = component->getDevice();
256+
if (dev == nullptr)
257+
return true;
258+
253259
auto otherComponent = another.getComponent();
260+
if (otherComponent == nullptr)
261+
return false;
254262
auto otherDev = otherComponent->getDevice();
255-
auto dev = component->getDevice();
263+
if (otherDev == nullptr)
264+
return false;
256265

257266
if (dev->getId() < otherDev->getId())
258267
return true;

0 commit comments

Comments
 (0)