Skip to content

Commit

Permalink
fix: crash in wireguard
Browse files Browse the repository at this point in the history
  • Loading branch information
hiddify-com committed Feb 14, 2024
1 parent 5bb845f commit 4d577cf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion transport/wireguard/device_stack.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,9 @@ func (w *StackDevice) Write(bufs [][]byte, offset int) (count int, err error) {
packetBuffer := stack.NewPacketBuffer(stack.PacketBufferOptions{
Payload: buffer.MakeWithData(b),
})
w.dispatcher.DeliverNetworkPacket(networkProtocol, packetBuffer)
if w.dispatcher != nil {
w.dispatcher.DeliverNetworkPacket(networkProtocol, packetBuffer)
}
packetBuffer.DecRef()
count++
}
Expand Down

0 comments on commit 4d577cf

Please sign in to comment.