зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1789959: Gracefully handle mCachedFields being null in xpcAccessible::GetCache. r=nlapre
Otherwise, we crash when inspecting RemoteAccessible objects in Dev Tools if the cache is disabled or hasn't been received yet. Differential Revision: https://phabricator.services.mozilla.com/D161872
This commit is contained in:
Родитель
8d586270bc
Коммит
f520d4fa05
|
@ -376,19 +376,18 @@ xpcAccessible::GetCache(nsIPersistentProperties** aCachedFields) {
|
|||
}
|
||||
|
||||
RefPtr<nsPersistentProperties> props = new nsPersistentProperties();
|
||||
if (IntlGeneric()->IsRemote()) {
|
||||
RefPtr<AccAttributes> cachedFields =
|
||||
IntlGeneric()->AsRemote()->mCachedFields;
|
||||
if (RemoteAccessible* remoteAcc = IntlGeneric()->AsRemote()) {
|
||||
if (RefPtr<AccAttributes> cachedFields = remoteAcc->mCachedFields) {
|
||||
nsAutoString unused;
|
||||
for (auto iter : *cachedFields) {
|
||||
nsAutoString name;
|
||||
iter.NameAsString(name);
|
||||
|
||||
nsAutoString unused;
|
||||
for (auto iter : *cachedFields) {
|
||||
nsAutoString name;
|
||||
iter.NameAsString(name);
|
||||
nsAutoString value;
|
||||
iter.ValueAsString(value);
|
||||
|
||||
nsAutoString value;
|
||||
iter.ValueAsString(value);
|
||||
|
||||
props->SetStringProperty(NS_ConvertUTF16toUTF8(name), value, unused);
|
||||
props->SetStringProperty(NS_ConvertUTF16toUTF8(name), value, unused);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче