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

Unified Diff: ui/views/cocoa/bridged_content_view.mm

Issue 2019233003: MacViews: Fix crash caused due to nil TextInputClient. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address nits. Created 4 years, 7 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 | ui/views/cocoa/bridged_native_widget_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/cocoa/bridged_content_view.mm
diff --git a/ui/views/cocoa/bridged_content_view.mm b/ui/views/cocoa/bridged_content_view.mm
index a59d4f0788461572994df001532e34bd5fbccace..daa31a2e348716f94396f42846f84a4b7bebe4e8 100644
--- a/ui/views/cocoa/bridged_content_view.mm
+++ b/ui/views/cocoa/bridged_content_view.mm
@@ -81,7 +81,7 @@ bool DispatchEventToMenu(views::Widget* widget, ui::KeyboardCode key_code) {
bool IsTextRTL(const ui::TextInputClient* client) {
gfx::Range text_range;
base::string16 text;
- return client->GetTextRange(&text_range) &&
+ return client && client->GetTextRange(&text_range) &&
client->GetTextFromRange(text_range, &text) &&
base::i18n::GetStringDirection(text) == base::i18n::RIGHT_TO_LEFT;
}
« no previous file with comments | « no previous file | ui/views/cocoa/bridged_native_widget_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698