addOverrideStylesheet can throw an exception when passed in a URL that doesn't exist

RESOLVED WONTFIX

Status

()

RESOLVED WONTFIX
9 years ago
7 years ago

People

(Reporter: davida, Unassigned)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

9 years ago
In mail/components/compose/content/MsgComposeCommands.js, we've found that calling addOverrideStyleSheet() _sometimes_ throws an NS_ERROR_INVALID_POINTER exception, if the URL passed in doesn't exist (in Thunderbird's case, pinstripe doesn't have a messageQuotes.css these days).

We're catching that exception and dealing with it for now, but the current behavior doesn't seem right -- at the very least the exception should be better chosen.
(Reporter)

Comment 1

9 years ago
see Bug 516322 for the bug that led to this one.
Based on a conversation with andreasn, the particular stylesheet in question either could to be added to all the other themes, or the contents could be moved to some other .css file to serve the same purpose.

Comment 3

7 years ago
(In reply to David Ascher (:davida) from comment #0)
> In mail/components/compose/content/MsgComposeCommands.js, we've found that
> calling addOverrideStyleSheet() _sometimes_ throws an
> NS_ERROR_INVALID_POINTER exception, if the URL passed in doesn't exist (in
> Thunderbird's case, pinstripe doesn't have a messageQuotes.css these days).

I don't think that we want the API to silently accept invalid parameters.  It is the responsibility of the caller to perform the required error checking.

This is the code in question: <http://mxr.mozilla.org/mozilla-central/source/editor/libeditor/html/nsHTMLEditor.cpp#3262>  The error is returned when we fail to retrieve the stylesheet.
Status: NEW → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.