Skip to content

Commit 036e5a0

Browse files
committed
fix endpoint nil pointer
1 parent 0223b8b commit 036e5a0

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

stack_gvisor.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,9 @@ func (t *GVisor) Start() error {
153153
}
154154

155155
func (t *GVisor) Close() error {
156-
t.endpoint.Attach(nil)
156+
if t.endpoint != nil {
157+
t.endpoint.Attach(nil)
158+
}
157159
t.stack.Close()
158160
for _, endpoint := range t.stack.CleanupEndpoints() {
159161
endpoint.Abort()

stack_mixed.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,9 @@ func (m *Mixed) packetLoop() {
261261
}
262262

263263
func (m *Mixed) Close() error {
264-
m.endpoint.Attach(nil)
264+
if m.endpoint != nil {
265+
m.endpoint.Attach(nil)
266+
}
265267
m.stack.Close()
266268
for _, endpoint := range m.stack.CleanupEndpoints() {
267269
endpoint.Abort()

0 commit comments

Comments
 (0)