Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
improve error message
  • Loading branch information
bparrishMines committed Jan 17, 2024
commit 8018c6170e616368dd63f93faf636a4904d62c03
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ class WebKitWebViewController extends PlatformWebViewController {
final String channelName = javaScriptChannelParams.name;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is somewhere already checking this isn't an empty string?

This parameter must be unique within the user content controller and must not be an empty string.

https://developer.apple.com/documentation/webkit/wkusercontentcontroller/1537172-addscriptmessagehandler

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (_javaScriptChannelParams.containsKey(channelName)) {
throw ArgumentError(
'A JavaScriptChannel with name `$channelName` has already been added.',
'A JavaScriptChannel with name `$channelName` already exists.',
);
}

Expand Down