add null ptr check to stop crash seen in talkback

This commit is contained in:
rickg%netscape.com 2000-03-28 01:08:36 +00:00
Родитель 81c455b21f
Коммит 90abf06a10
2 изменённых файлов: 54 добавлений и 42 удалений

Просмотреть файл

@ -739,10 +739,15 @@ FrameManager::DequeuePostedEventFor(nsIFrame* aFrame)
}
void
FrameManager::HandlePLEvent(CantRenderReplacedElementEvent* aEvent)
{
FrameManager::HandlePLEvent(CantRenderReplacedElementEvent* aEvent) {
FrameManager* frameManager = (FrameManager*)aEvent->owner;
//adding a ptr check since talkback is complaining about a crash here.
//I suspect that if the event->owner is really null, bad things will happen
//elsewhere.
if(frameManager) {
// Remove the posted event from the linked list
CantRenderReplacedElementEvent** events = &frameManager->mPostedEvents;
while (*events) {
@ -761,6 +766,7 @@ FrameManager::HandlePLEvent(CantRenderReplacedElementEvent* aEvent)
frameManager->mPresShell->GetPresContext(getter_AddRefs(presContext));
frameManager->mStyleSet->CantRenderReplacedElement(presContext, aEvent->mFrame);
frameManager->mPresShell->ExitReflowLock(PR_TRUE);
}
}
void

Просмотреть файл

@ -739,10 +739,15 @@ FrameManager::DequeuePostedEventFor(nsIFrame* aFrame)
}
void
FrameManager::HandlePLEvent(CantRenderReplacedElementEvent* aEvent)
{
FrameManager::HandlePLEvent(CantRenderReplacedElementEvent* aEvent) {
FrameManager* frameManager = (FrameManager*)aEvent->owner;
//adding a ptr check since talkback is complaining about a crash here.
//I suspect that if the event->owner is really null, bad things will happen
//elsewhere.
if(frameManager) {
// Remove the posted event from the linked list
CantRenderReplacedElementEvent** events = &frameManager->mPostedEvents;
while (*events) {
@ -761,6 +766,7 @@ FrameManager::HandlePLEvent(CantRenderReplacedElementEvent* aEvent)
frameManager->mPresShell->GetPresContext(getter_AddRefs(presContext));
frameManager->mStyleSet->CantRenderReplacedElement(presContext, aEvent->mFrame);
frameManager->mPresShell->ExitReflowLock(PR_TRUE);
}
}
void