bug=34896 extra check for null in caret. this can happen sometimes when frame is destroyed in odd order. r=hyatt.

This commit is contained in:
mjudge%netscape.com 2000-06-07 01:18:41 +00:00
Родитель 9703a755f8
Коммит f0063052b2
2 изменённых файлов: 10 добавлений и 2 удалений

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

@ -337,7 +337,9 @@ NS_IMETHODIMP nsCaret::NotifySelectionChanged(nsIDOMDocument *, nsIDOMSelection
{
if (mVisible)
StopBlinking();
mDomSelectionWeak = getter_AddRefs( NS_GetWeakReference(aDomSel) ); // weak reference to pres shell
nsCOMPtr<nsIDOMSelection> domSel(do_QueryReferent(mDomSelectionWeak));
if (domSel.get() != aDomSel)
return NS_OK; //ignore this then.
if (mVisible)
StartBlinking();
@ -556,6 +558,8 @@ PRBool nsCaret::MustDrawCaret()
return PR_TRUE;
nsCOMPtr<nsIDOMSelection> domSelection = do_QueryReferent(mDomSelectionWeak);
if (!domSelection)
return PR_FALSE;
PRBool isCollapsed;
if (NS_FAILED(domSelection->GetIsCollapsed(&isCollapsed)))

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

@ -337,7 +337,9 @@ NS_IMETHODIMP nsCaret::NotifySelectionChanged(nsIDOMDocument *, nsIDOMSelection
{
if (mVisible)
StopBlinking();
mDomSelectionWeak = getter_AddRefs( NS_GetWeakReference(aDomSel) ); // weak reference to pres shell
nsCOMPtr<nsIDOMSelection> domSel(do_QueryReferent(mDomSelectionWeak));
if (domSel.get() != aDomSel)
return NS_OK; //ignore this then.
if (mVisible)
StartBlinking();
@ -556,6 +558,8 @@ PRBool nsCaret::MustDrawCaret()
return PR_TRUE;
nsCOMPtr<nsIDOMSelection> domSelection = do_QueryReferent(mDomSelectionWeak);
if (!domSelection)
return PR_FALSE;
PRBool isCollapsed;
if (NS_FAILED(domSelection->GetIsCollapsed(&isCollapsed)))