@@ -209,25 +209,31 @@ bool FlutterWebRTCBase::CreateIceServers(const EncodableList &iceServersArray,
209
209
if (TypeIs<EncodableList>(it->second )) {
210
210
const EncodableList urls = GetValue<EncodableList>(it->second );
211
211
for (auto url : urls) {
212
- const EncodableMap map = GetValue<EncodableMap>(url);
213
- std::string value;
214
- auto it2 = map.find (EncodableValue (" url" ));
215
- if (it2 != map.end ()) {
216
- value = GetValue<std::string>(it2->second );
217
- if (hasUsernameAndCredential) {
218
- std::string username =
219
- GetValue<std::string>(iceServerMap.find (EncodableValue (" username" ))
220
- ->second );
221
- std::string credential =
222
- GetValue<std::string>(iceServerMap.find (EncodableValue (" credential" ))
223
- ->second );
224
- ice_server.username = username;
225
- ice_server.password = credential;
226
- ice_server.uri = value;
227
- } else {
228
- ice_server.uri = value;
212
+ if (TypeIs<EncodableMap>(url)) {
213
+ const EncodableMap map = GetValue<EncodableMap>(url);
214
+ std::string value;
215
+ auto it2 = map.find (EncodableValue (" url" ));
216
+ if (it2 != map.end ()) {
217
+ value = GetValue<std::string>(it2->second );
218
+ if (hasUsernameAndCredential) {
219
+ std::string username =
220
+ GetValue<std::string>(iceServerMap.find (EncodableValue (" username" ))
221
+ ->second );
222
+ std::string credential =
223
+ GetValue<std::string>(iceServerMap.find (EncodableValue (" credential" ))
224
+ ->second );
225
+ ice_server.username = username;
226
+ ice_server.password = credential;
227
+ ice_server.uri = value;
228
+ } else {
229
+ ice_server.uri = value;
230
+ }
229
231
}
230
232
}
233
+ else if (TypeIs<std::string>(url)) {
234
+ std::string urlString = GetValue<std::string>(url);
235
+ ice_server.uri = urlString;
236
+ }
231
237
}
232
238
}
233
239
}
0 commit comments