Skip to content

Commit

Permalink
feat: add nil pointer check
Browse files Browse the repository at this point in the history
Signed-off-by: peefy <xpf6677@163.com>
  • Loading branch information
Peefy committed Sep 18, 2024
1 parent 6a6d0e7 commit 50ffba9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion go/native/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ func NewNativeServiceClientWithPluginAgent(pluginAgent uint64) *NativeServiceCli
c := new(NativeServiceClient)
c.svc = serviceNew(pluginAgent)
runtime.SetFinalizer(c, func(x *NativeServiceClient) {
serviceDelete(x.svc)
if x.svc != 0 {
serviceDelete(x.svc)
}
closeLibrary(lib)
})
return c
Expand Down

0 comments on commit 50ffba9

Please sign in to comment.