Add more error handling and mutex guards

This commit is contained in:
Pijus Kamandulis
2025-01-27 21:09:37 +02:00
parent d6b816b55a
commit 125f10d8a2
8 changed files with 62 additions and 26 deletions

View File

@@ -45,7 +45,10 @@ func GetDatabase(serverName *C.char, databaseId *C.char) *C.char {
return C.CString("")
}
databaseJson, _ := json.Marshal(database)
databaseJson, err := json.Marshal(database)
if err != nil {
return C.CString("")
}
return C.CString(string(databaseJson))
}