Sfoglia il codice sorgente

fix panic when close with not start in sdk

刘河 5 anni fa
parent
commit
999fac8ad7
1 ha cambiato i file con 3 aggiunte e 1 eliminazioni
  1. 3 1
      cmd/npc/sdk.go

+ 3 - 1
cmd/npc/sdk.go

@@ -31,7 +31,9 @@ func GetClientStatus() int {
 
 //export CloseClient
 func CloseClient() {
-	cl.Close()
+	if cl != nil {
+		cl.Close()
+	}
 }
 
 //export Version