diff --git a/editor/base/nsEditorShell.cpp b/editor/base/nsEditorShell.cpp index fb19d1194be1..6c6879c208b5 100644 --- a/editor/base/nsEditorShell.cpp +++ b/editor/base/nsEditorShell.cpp @@ -1723,9 +1723,8 @@ nsEditorShell::UpdateWindowTitle() if (diskDoc) { // find out if the doc already has a fileSpec associated with it. - nsFileSpec docFileSpec; - PRBool noFileSpec = (diskDoc->GetFileSpec(docFileSpec) == NS_ERROR_NOT_INITIALIZED); - if ((docFileSpec != nsnull) && !noFileSpec) + nsFileSpec docFileSpec; + if (NS_SUCCEEDED(diskDoc->GetFileSpec(docFileSpec))) { char *name = docFileSpec.GetLeafName(); if (name) diff --git a/editor/composer/src/nsEditorShell.cpp b/editor/composer/src/nsEditorShell.cpp index fb19d1194be1..6c6879c208b5 100644 --- a/editor/composer/src/nsEditorShell.cpp +++ b/editor/composer/src/nsEditorShell.cpp @@ -1723,9 +1723,8 @@ nsEditorShell::UpdateWindowTitle() if (diskDoc) { // find out if the doc already has a fileSpec associated with it. - nsFileSpec docFileSpec; - PRBool noFileSpec = (diskDoc->GetFileSpec(docFileSpec) == NS_ERROR_NOT_INITIALIZED); - if ((docFileSpec != nsnull) && !noFileSpec) + nsFileSpec docFileSpec; + if (NS_SUCCEEDED(diskDoc->GetFileSpec(docFileSpec))) { char *name = docFileSpec.GetLeafName(); if (name)