File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -105,7 +105,8 @@ async def prepare_forward(
105105
106106 # Grab our target to pack the initial message to, then pack the message
107107 # for the DID target
108- next_target = chain .pop (0 )["did" ]
108+ final_destination = chain .pop (0 )
109+ next_target = final_destination ["did" ]
109110 packed_message = encoded_message
110111
111112 # Loop through the entire services chain and pack the message for each
@@ -130,4 +131,7 @@ async def prepare_forward(
130131
131132 # Return the forward-packed message as well as the last service in the
132133 # chain, which is the destination of the top-level forward message.
133- return (packed_message , chain [- 1 ]["service" ])
134+ service = final_destination ["service" ]
135+ if len (chain ):
136+ service = chain [- 1 ]["service" ]
137+ return (packed_message , service )
You can’t perform that action at this time.
0 commit comments