Fix for bug 307245 (ASSERTION: FormatStringFromName() without format parameters: use GetStringFromName() instead: 'aParams && aLength' @ nsStringBundle::FormatStringFromName(). r/sr=jst.
git-svn-id: svn://10.0.0.236/trunk@180910 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -2311,6 +2311,10 @@ nsContentUtils::ReportToConsole(PropertiesFile aFile,
|
||||
PRUint32 aErrorFlags,
|
||||
const char *aCategory)
|
||||
{
|
||||
NS_ASSERTION((aParams && aParamsLength) || (!aParams && !aParamsLength),
|
||||
"Supply either both parameters and their number or no"
|
||||
"parameters and 0.");
|
||||
|
||||
nsresult rv;
|
||||
if (!sConsoleService) { // only need to bother null-checking here
|
||||
rv = CallGetService(NS_CONSOLESERVICE_CONTRACTID, &sConsoleService);
|
||||
@@ -2318,8 +2322,13 @@ nsContentUtils::ReportToConsole(PropertiesFile aFile,
|
||||
}
|
||||
|
||||
nsXPIDLString errorText;
|
||||
rv = FormatLocalizedString(aFile, aMessageName, aParams, aParamsLength,
|
||||
errorText);
|
||||
if (aParams) {
|
||||
rv = FormatLocalizedString(aFile, aMessageName, aParams, aParamsLength,
|
||||
errorText);
|
||||
}
|
||||
else {
|
||||
rv = GetLocalizedString(aFile, aMessageName, errorText);
|
||||
}
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsCAutoString spec;
|
||||
|
||||
Reference in New Issue
Block a user