Skip to content

Commit 710d2ed

Browse files
committed
avm1: Don't panic on new NetConnection() with less than 3 args
1 parent e01f163 commit 710d2ed

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

core/src/avm1/globals/netconnection.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,10 @@ fn call<'gc>(
271271
.coerce_to_string(activation)?;
272272
let mut arguments = Vec::new();
273273

274-
for arg in &args[2..] {
275-
arguments.push(Rc::new(serialize(activation, *arg)));
274+
if args.len() > 2 {
275+
for arg in &args[2..] {
276+
arguments.push(Rc::new(serialize(activation, *arg)));
277+
}
276278
}
277279

278280
if let Some(handle) = net_connection.handle() {

0 commit comments

Comments
 (0)