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
parent 63aa4a87a2
commit 04f25bd738

View File

@ -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;