From f51913c569b7ef16b5906c3a1be3e9d786ca603c Mon Sep 17 00:00:00 2001 From: Tom Date: Fri, 3 Jul 2020 11:59:52 +0100 Subject: [PATCH] Check if control point is running before InspectDevice is called - fixes crash. --- Source/Core/PltCtrlPoint.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Source/Core/PltCtrlPoint.cpp b/Source/Core/PltCtrlPoint.cpp index 19620d44..405c1fd9 100644 --- a/Source/Core/PltCtrlPoint.cpp +++ b/Source/Core/PltCtrlPoint.cpp @@ -1243,6 +1243,13 @@ PLT_CtrlPoint::InspectDevice(const NPT_HttpUrl& location, { NPT_AutoLock lock(m_Lock); + // check if control point has been started + if (!m_Started) { + NPT_LOG_INFO_1("InspectDevice called before control point started. location url: %s", + (const char*) location.ToString()); + return NPT_FAILURE; + } + // check if already inspecting device NPT_String pending_uuid; if (NPT_SUCCEEDED(NPT_ContainerFind(m_PendingInspections,