Skip to content

Commit

Permalink
Fix mistake made when addressing PR comment
Browse files Browse the repository at this point in the history
  • Loading branch information
tehampson committed Aug 6, 2024
1 parent cf1a738 commit 7389945
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ CHIP_ERROR EcosystemInformationServer::AddEcosystemInformationClusterToEndpoint(
// We expect that the device has not been previously added.
VerifyOrReturnError((it == mDevicesMap.end()), CHIP_ERROR_INCORRECT_STATE);
// This create an empty DeviceInfo in mDevicesMap.
mDevicesMap[aEndpoint];
mDevicesMap[aEndpoint] = DeviceInfo();
return CHIP_NO_ERROR;
}

Expand All @@ -259,7 +259,7 @@ CHIP_ERROR EcosystemInformationServer::AddDeviceInfo(EndpointId aEndpoint, std::
VerifyOrReturnError(aDevice, CHIP_ERROR_INVALID_ARGUMENT);
VerifyOrReturnError((aEndpoint != kRootEndpointId && aEndpoint != kInvalidEndpointId), CHIP_ERROR_INVALID_ARGUMENT);

auto & deviceInfo = mDevicesMap[aEndpoint] = DeviceInfo();
auto & deviceInfo = mDevicesMap[aEndpoint];
VerifyOrReturnError((deviceInfo.mDeviceDirectory.size() < kDeviceDirectoryMaxSize), CHIP_ERROR_NO_MEMORY);
deviceInfo.mDeviceDirectory.push_back(std::move(aDevice));
return CHIP_NO_ERROR;
Expand Down

0 comments on commit 7389945

Please sign in to comment.