From 906e5580a5eea7c230730cd8608f8e43f808d509 Mon Sep 17 00:00:00 2001 From: Daniel Holbert Date: Tue, 10 Jan 2012 15:32:58 -0800 Subject: [PATCH] Bug 717004: Drop unused/unnecessary rv from GetLayoutHistoryAndKey, and check rv of nsILayoutHistoryState::GetState before using its output. r=volkmar --- content/html/content/src/nsGenericHTMLElement.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/content/html/content/src/nsGenericHTMLElement.cpp b/content/html/content/src/nsGenericHTMLElement.cpp index 8300ac19c722..cb28a0c1465f 100644 --- a/content/html/content/src/nsGenericHTMLElement.cpp +++ b/content/html/content/src/nsGenericHTMLElement.cpp @@ -1624,16 +1624,16 @@ nsGenericHTMLElement::RestoreFormControlState(nsGenericHTMLElement* aContent, { nsCOMPtr history; nsCAutoString key; - nsresult rv = GetLayoutHistoryAndKey(aContent, true, - getter_AddRefs(history), key); + GetLayoutHistoryAndKey(aContent, true, + getter_AddRefs(history), key); if (!history) { return false; } nsPresState *state; // Get the pres state for this key - rv = history->GetState(key, &state); - if (state) { + nsresult rv = history->GetState(key, &state); + if (NS_SUCCEEDED(rv) && state) { bool result = aControl->RestoreState(state); history->RemoveState(key); return result;