From 21df8fb73a741c49455efd88ab57c50698993992 Mon Sep 17 00:00:00 2001 From: Chris Bracken Date: Thu, 29 Apr 2021 09:02:28 -0700 Subject: [PATCH] Correct an inverted null pointer check (flutter/engine#25828) In unmarkText, we want to prevent dereferencing _activeModel if it's null. --- .../darwin/macos/framework/Source/FlutterTextInputPlugin.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/src/flutter/shell/platform/darwin/macos/framework/Source/FlutterTextInputPlugin.mm b/engine/src/flutter/shell/platform/darwin/macos/framework/Source/FlutterTextInputPlugin.mm index 75fba93c4c..71ed1f655d 100644 --- a/engine/src/flutter/shell/platform/darwin/macos/framework/Source/FlutterTextInputPlugin.mm +++ b/engine/src/flutter/shell/platform/darwin/macos/framework/Source/FlutterTextInputPlugin.mm @@ -414,7 +414,7 @@ static flutter::TextRange RangeFromBaseExtent(NSNumber* base, } - (void)unmarkText { - if (_activeModel != nullptr) { + if (_activeModel == nullptr) { return; } _activeModel->CommitComposing();