Closed Bug 1077371 Opened 10 years ago Closed 10 years ago

remove null-checks on the result of gfxFontGroup::GetFirstValidFont

Categories

(Core :: Graphics: Text, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla35

People

(Reporter: jfkthame, Assigned: jfkthame)

Details

Attachments

(1 file)

Many callers of gfxFontGroup::GetFirstValidFont() just use the returned pointer directly (e.g. dereferencing it to call methods on the gfxFont).

This is safe because GetFirstValidFont() will always return a valid font -- unless we end up at the NS_RUNTIMEABORT in gfxFontGroup::GetDefaultFont().

Hence, we should clean up the remaining callsites that use GetFirstValidFont() and then check the result for nullptr (and do an early return, or whatever) before trying to use it.
Assignee: nobody → jfkthame
Status: NEW → ASSIGNED
Attachment #8499564 - Flags: review?(jdaggett) → review+
https://hg.mozilla.org/mozilla-central/rev/af19f500d78b
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.