Skip to content

Commit 50ffba9

Browse files
committed
feat: add nil pointer check
Signed-off-by: peefy <[email protected]>
1 parent 6a6d0e7 commit 50ffba9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

go/native/client.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ func NewNativeServiceClientWithPluginAgent(pluginAgent uint64) *NativeServiceCli
5252
c := new(NativeServiceClient)
5353
c.svc = serviceNew(pluginAgent)
5454
runtime.SetFinalizer(c, func(x *NativeServiceClient) {
55-
serviceDelete(x.svc)
55+
if x.svc != 0 {
56+
serviceDelete(x.svc)
57+
}
5658
closeLibrary(lib)
5759
})
5860
return c

0 commit comments

Comments
 (0)