Bug 385716 inIFlasher.drawElementOutline and inIFlasher.repaintElement aren't null safe [@ inLayoutUtils::GetWindowFor]

r=bz sr=bz
This commit is contained in:
timeless@mozdev.org 2007-07-01 12:13:13 -07:00
Родитель 9da968b142
Коммит 51244bcf9d
1 изменённых файлов: 3 добавлений и 2 удалений

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

@ -134,6 +134,7 @@ inFlasher::SetInvert(PRBool aInvert)
NS_IMETHODIMP
inFlasher::RepaintElement(nsIDOMElement* aElement)
{
NS_ENSURE_ARG_POINTER(aElement);
nsCOMPtr<nsIDOMWindowInternal> window = inLayoutUtils::GetWindowFor(aElement);
if (!window) return NS_OK;
nsCOMPtr<nsIPresShell> presShell = inLayoutUtils::GetPresShellFor(window);
@ -149,6 +150,7 @@ inFlasher::RepaintElement(nsIDOMElement* aElement)
NS_IMETHODIMP
inFlasher::DrawElementOutline(nsIDOMElement* aElement)
{
NS_ENSURE_ARG_POINTER(aElement);
nsCOMPtr<nsIDOMWindowInternal> window = inLayoutUtils::GetWindowFor(aElement);
if (!window) return NS_OK;
nsCOMPtr<nsIPresShell> presShell = inLayoutUtils::GetPresShellFor(window);
@ -183,8 +185,7 @@ inFlasher::DrawElementOutline(nsIDOMElement* aElement)
NS_IMETHODIMP
inFlasher::ScrollElementIntoView(nsIDOMElement *aElement)
{
NS_PRECONDITION(aElement, "Dude, where's my arg?!");
NS_ENSURE_ARG_POINTER(aElement);
nsCOMPtr<nsIDOMWindowInternal> window = inLayoutUtils::GetWindowFor(aElement);
if (!window) {
return NS_OK;