Bug 1132528 - Handle non existent key r=nical

This commit is contained in:
Sotaro Ikeda 2015-03-03 06:36:48 -08:00
parent d768d0fcaf
commit 02956da7c1

View File

@ -53,6 +53,10 @@ public:
for (it = SharedBufferManagerParent::sManagers.begin(); it != SharedBufferManagerParent::sManagers.end(); it++) {
base::ProcessId pid = it->first;
SharedBufferManagerParent *mgr = it->second;
if (!mgr) {
printf_stderr("GrallocReporter::CollectReports() mgr is nullptr");
continue;
}
nsAutoCString pidName;
LinuxUtils::GetThreadName(pid, pidName);
@ -332,7 +336,11 @@ MessageLoop* SharedBufferManagerParent::GetMessageLoop()
SharedBufferManagerParent* SharedBufferManagerParent::GetInstance(ProcessId id)
{
NS_ASSERTION(sManagers.count(id) == 1, "No BufferManager for the process");
return sManagers[id];
if (sManagers.count(id) == 1) {
return sManagers[id];
} else {
return nullptr;
}
}
#ifdef MOZ_HAVE_SURFACEDESCRIPTORGRALLOC