Skip to content

Commit 4f03173

Browse files
authored
Fix parsing bug for dispose method (#173)
In PlatformViewChannel::HandleMethodCall, a argument for 'dispose' method includes a map. Hence, to get a proper view_id value, it should be parsed by 'id' key.
1 parent e0d81c7 commit 4f03173

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

shell/platform/tizen/channels/platform_view_channel.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,8 @@ void PlatformViewChannel::HandleMethodCall(
165165
}
166166
} else if (method == "dispose") {
167167
int view_id = -1;
168-
if (std::holds_alternative<int>(arguments)) {
169-
view_id = std::get<int>(arguments);
170-
};
171-
if (view_id < 0 || view_instances_.find(view_id) == view_instances_.end()) {
168+
if (!GetValueFromEncodableMap(arguments, "id", &view_id) ||
169+
view_instances_.find(view_id) == view_instances_.end()) {
172170
result->Error("Can't find view id");
173171
} else {
174172
RemoveViewInstanceIfNeeded(view_id);

0 commit comments

Comments
 (0)