Skip to content

Commit

Permalink
Adding null check for IResourceManagerClient in dump()
Browse files Browse the repository at this point in the history
bug: 191613308
Change-Id: I1694f2d1c13163a9b8162630377de71303bc517f
  • Loading branch information
Arun Johnson authored and thestinger committed Sep 18, 2023
1 parent b023ec3 commit c8117d1
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions services/mediaresourcemanager/ResourceManagerService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,10 +271,9 @@ binder_status_t ResourceManagerService::dump(int fd, const char** /*args*/, uint
snprintf(buffer, SIZE, " Id: %lld\n", (long long)infos[j].clientId);
result.append(buffer);

std::string clientName;
Status status = infos[j].client->getName(&clientName);
if (!status.isOk()) {
clientName = "<unknown client>";
std::string clientName = "<unknown client>";
if (infos[j].client != nullptr) {
Status status = infos[j].client->getName(&clientName);
}
snprintf(buffer, SIZE, " Name: %s\n", clientName.c_str());
result.append(buffer);
Expand Down

0 comments on commit c8117d1

Please sign in to comment.