-
Notifications
You must be signed in to change notification settings - Fork 6k
Fix a crash when setting clipboardData to null on iOS #32413
Conversation
shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.mm
Outdated
Show resolved
Hide resolved
__block bool value; | ||
FlutterResult result = ^(id result) { | ||
called = true; | ||
value = result[@"value"]; | ||
value = [result[@"value"] boolValue]; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The __block
pattern that was here and you copied is kind of hard to read imo since the assertion about the value is after the method call, how about:
XCTestExpectation *hasStringsExpectation = [self expectationWithDescription:@"hasStrings"];
FlutterResult result = ^(id result) {
XCTAssertTrue(result[@"value"]);
[hasStringsExpectation fulfill];
};
...
[self waitForExpectationsWithTimeout:1 handler:nil];
At the least these should be BOOL
and not bool
and XCTAssertTrue(called);
@jmagman Updated. PTAL |
@"PointerData.time_stamp should be equal to NSProcessInfo.systemUptime"); | ||
} | ||
@end | ||
//// Copyright 2013 The Flutter Authors. All rights reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Guessing you didn't mean to check this in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
* 9b3117a Create `ImageFilter.dilate`/`ImageFilter.erode` (flutter/engine#32334) * 92a6ade Roll Fuchsia Mac SDK from m_-rjFvCk... to hJaq9O7XI... (flutter/engine#32402) * 31fd1bb Roll Fuchsia Linux SDK from 5abhmXb9Q... to WdxX5Sqix... (flutter/engine#32403) * f088801 Roll Skia from 5215ec1ab9cd to fd9c66e18030 (1 revision) (flutter/engine#32406) * ac21195 Fix inconsistent enum/class private member naming (flutter/engine#32409) * 75e7cfd Fix deltas when selection is active and composing begins on MacOS (flutter/engine#32412) * 7e5989b Fix SemanticsAction naming consistency (flutter/engine#32411) * 1b3e9dc Fix a crash when setting clipboardData to null on iOS (flutter/engine#32413) * ef50b28 Roll Fuchsia Linux SDK from WdxX5Sqix... to PmeDIogNb... (flutter/engine#32422) * b48d65e Roll Fuchsia Mac SDK from hJaq9O7XI... to WBAQhRswX... (flutter/engine#32423)
The crash is described in flutter/flutter#101234
The fix is to make sure the argument is a String before propagating the value to the paste board object.
This PR also fixed an existing false positive test. The
testHasStrings
test passes because we were checking if an object is nil instead of checking the actual bool value. The test should have failed because the wrong method channel name was used.Fixes: flutter/flutter#101234
Pre-launch Checklist
writing and running engine tests.
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.