Skip to content

Commit 699578b

Browse files
committed
Fixed reference to session in MultipeerConnection
1 parent 9c27242 commit 699578b

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

Sources/MultipeerKit/Internal API/MultipeerConnection.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,10 @@ extension MultipeerConnection: MCNearbyServiceAdvertiserDelegate {
219219

220220
guard let peer = discoveredPeers[peerID] else { return }
221221

222-
configuration.security.invitationHandler(peer, context, { decision in
223-
invitationHandler(decision, decision ? session : nil)
222+
configuration.security.invitationHandler(peer, context, { [weak self] decision in
223+
guard let self = self else { return }
224+
225+
invitationHandler(decision, decision ? self.session : nil)
224226
})
225227
}
226228

0 commit comments

Comments
 (0)