Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit a9dafdb

Browse files
Fix the CanvasPath::CreateNew signature to avoid unnecessary Dart API::NewError calls (#32791)
1 parent 60c198f commit a9dafdb

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lib/ui/painting/path.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class CanvasPath : public RefCountedDartWrappable<CanvasPath> {
2424

2525
public:
2626
~CanvasPath() override;
27-
static fml::RefPtr<CanvasPath> CreateNew(Dart_Handle path_handle) {
27+
static fml::RefPtr<CanvasPath> CreateNew() {
2828
return fml::MakeRefCounted<CanvasPath>();
2929
}
3030

third_party/tonic/converter/dart_converter.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,9 @@ struct DartConverter<Dart_Handle> {
560560
static NativeType FromArguments(Dart_NativeArguments args,
561561
int index,
562562
Dart_Handle& exception) {
563-
return Dart_GetNativeArgument(args, index);
563+
Dart_Handle result = Dart_GetNativeArgument(args, index);
564+
TONIC_DCHECK(!Dart_IsError(result));
565+
return result;
564566
}
565567

566568
static NativeType FromFfi(FfiType val) { return val; }

0 commit comments

Comments
 (0)