diff --git a/src/runtime2/component/component.rs b/src/runtime2/component/component.rs index 53c362b7058caf4c05f741de40eb19604767d410..5e7bc0486149e21eb5da1081357caaf12687971d 100644 --- a/src/runtime2/component/component.rs +++ b/src/runtime2/component/component.rs @@ -433,8 +433,10 @@ pub(crate) fn default_handle_received_data_message( let _new_inbox_index = inbox_main.len(); if !received_port.messages.is_empty() { inbox_main.push(Some(received_port.messages.remove(0))); + inbox_backup.extend(received_port.messages.drain(..)); + } else { + inbox_main.push(None); } - inbox_backup.extend(received_port.messages.drain(..)); // Create a new port locally let mut new_port_state = received_port.state;