Skip to content

Commit 47ff412

Browse files
committed
fix: ensure extraOptions does not contain 'from', 'to' keys
1 parent 56b987d commit 47ff412

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/_internal/twilio_voice_web.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -786,8 +786,9 @@ class Call extends MethodChannelTwilioCall {
786786
"Twilio device is null, make sure you have initialized the device first by calling [ setTokens({required String accessToken, String? deviceToken}) ] ");
787787
assert(from.isNotEmpty, "'from' cannot be empty");
788788
assert(to.isNotEmpty, "'to' cannot be empty");
789-
assert(extraOptions?.keys.contains("From") ?? true, "From cannot be passed in extraOptions");
790-
assert(extraOptions?.keys.contains("To") ?? true, "To cannot be passed in extraOptions");
789+
final options = (extraOptions ?? {});
790+
assert(!options.keys.contains("From"), "'from' cannot be passed in 'extraOptions'");
791+
assert(!options.keys.contains("To"), "'to' cannot be passed in 'extraOptions'");
791792

792793
Logger.logLocalEvent("Making new call");
793794
// handle parameters

0 commit comments

Comments
 (0)