Bug 783383 - Add null-checks for nsBaseWidget::mWidgetListener r=tn

This commit is contained in:
Andrew Quartey 2012-08-17 11:36:34 -04:00
Родитель 80f272156f
Коммит e757e51d27
1 изменённых файлов: 5 добавлений и 0 удалений

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

@ -1370,6 +1370,9 @@ void
nsBaseWidget::NotifyUIStateChanged(UIStateChangeType aShowAccelerators,
UIStateChangeType aShowFocusRings)
{
if (!mWidgetListener)
return;
nsIPresShell* presShell = mWidgetListener->GetPresShell();
nsIDocument* doc = presShell->GetDocument();
if (doc) {
@ -1385,6 +1388,8 @@ nsBaseWidget::NotifyUIStateChanged(UIStateChangeType aShowAccelerators,
Accessible*
nsBaseWidget::GetAccessible()
{
NS_ENSURE_TRUE(mWidgetListener, nullptr);
nsIPresShell* presShell = mWidgetListener->GetPresShell();
NS_ENSURE_TRUE(presShell, nullptr);