diff --git a/editor/libeditor/html/nsHTMLEditor.cpp b/editor/libeditor/html/nsHTMLEditor.cpp
index e07405eb6cd5..3b96e695e820 100644
--- a/editor/libeditor/html/nsHTMLEditor.cpp
+++ b/editor/libeditor/html/nsHTMLEditor.cpp
@@ -3372,7 +3372,7 @@ nsHTMLEditor::ReplaceStyleSheet(const nsAString& aURL)
if (EnableExistingStyleSheet(aURL))
{
// Disable last sheet if not the same as new one
- if (!mLastStyleSheetURL.IsEmpty() && mLastStyleSheetURL.Equals(aURL))
+ if (!mLastStyleSheetURL.IsEmpty() && !mLastStyleSheetURL.Equals(aURL))
return EnableStyleSheet(mLastStyleSheetURL, PR_FALSE);
return NS_OK;