Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(520)

Unified Diff: content/common/mac/attributed_string_coder.mm

Issue 1052523006: Don't crash when using IME on an input field with a CSS-specified font. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/common/mac/font_descriptor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/mac/attributed_string_coder.mm
diff --git a/content/common/mac/attributed_string_coder.mm b/content/common/mac/attributed_string_coder.mm
index bcd8b118c5543ee773bab42063fc2d19a2416d61..ed377bb91d1374045be73e6548d2b256be3c31b9 100644
--- a/content/common/mac/attributed_string_coder.mm
+++ b/content/common/mac/attributed_string_coder.mm
@@ -100,10 +100,12 @@ AttributedStringCoder::FontAttribute::FontAttribute()
AttributedStringCoder::FontAttribute::~FontAttribute() {
}
-NSDictionary* AttributedStringCoder::FontAttribute::ToAttributesDictionary(
- void) const {
+NSDictionary*
+AttributedStringCoder::FontAttribute::ToAttributesDictionary() const {
DCHECK(ShouldEncode());
NSFont* font = font_descriptor_.ToNSFont();
+ if (!font)
+ return [NSDictionary dictionary];
return [NSDictionary dictionaryWithObject:font forKey:NSFontAttributeName];
}
« no previous file with comments | « no previous file | content/common/mac/font_descriptor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698