diff --git a/src/app/clusters/diagnostic-logs-server/diagnostic-logs-server.cpp b/src/app/clusters/diagnostic-logs-server/diagnostic-logs-server.cpp index 91b1ff5554cba4..19cdad18e6db45 100644 --- a/src/app/clusters/diagnostic-logs-server/diagnostic-logs-server.cpp +++ b/src/app/clusters/diagnostic-logs-server/diagnostic-logs-server.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include #include diff --git a/src/darwin/Framework/CHIP/MTRDevice.mm b/src/darwin/Framework/CHIP/MTRDevice.mm index 1591c31e525c69..e4c76cd6a4a4dd 100644 --- a/src/darwin/Framework/CHIP/MTRDevice.mm +++ b/src/darwin/Framework/CHIP/MTRDevice.mm @@ -1437,7 +1437,7 @@ - (void)_downloadLogOfType:(MTRDiagnosticLogType)type [self _invokeCompletionWithError:completion queue:queue error:[NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeInvalidState userInfo:nil]]; } - if (self->_diagnosticLogsTransferHandler != nullptr && self->_diagnosticLogsTransferHandler->IsInBDXSession()) { + if (self->_diagnosticLogsTransferHandler != nil && self->_diagnosticLogsTransferHandler->IsInBDXSession()) { [self _invokeCompletionWithError:completion queue:queue error:[NSError errorWithDomain:MTRInteractionErrorDomain code:MTRInteractionErrorCodeBusy userInfo:nil]]; } @@ -1471,7 +1471,7 @@ - (void)_downloadLogOfType:(MTRDiagnosticLogType)type [cluster retrieveLogsRequestWithParams:requestParams expectedValues:nil expectedValueInterval:nil completion:^(MTRDiagnosticLogsClusterRetrieveLogsResponseParams * _Nullable response, NSError * _Nullable error) { // If we are in a BDX session and there is no error, do nothing. Completion will be called when BDX succeeds or fails. - if (self->_diagnosticLogsTransferHandler->IsInBDXSession() && error == nil) { + if (self->_diagnosticLogsTransferHandler != nil && self->_diagnosticLogsTransferHandler->IsInBDXSession() && error == nil) { return; } diff --git a/src/protocols/bdx/TransferFacilitator.cpp b/src/protocols/bdx/TransferFacilitator.cpp index 604eec88d40975..fbe563187b6fb9 100644 --- a/src/protocols/bdx/TransferFacilitator.cpp +++ b/src/protocols/bdx/TransferFacilitator.cpp @@ -114,7 +114,6 @@ CHIP_ERROR Responder::PrepareForTransfer(System::Layer * layer, TransferRole rol void Responder::ResetTransfer() { mTransfer.Reset(); - mSystemLayer = nullptr; ChipLogProgress(BDX, "Stop polling for messages"); mStopPolling = true; } @@ -136,7 +135,6 @@ CHIP_ERROR Initiator::InitiateTransfer(System::Layer * layer, TransferRole role, void Initiator::ResetTransfer() { mTransfer.Reset(); - mSystemLayer = nullptr; ChipLogProgress(BDX, "Stop polling for messages"); mStopPolling = true; }