fix: add ctx data dir check for database initialization
This commit is contained in:
@ -9,6 +9,11 @@ bool lm_ctx_database_init(lm_ctx_t *ctx){
|
||||
if(ctx->db != NULL)
|
||||
return true;
|
||||
|
||||
if(NULL == ctx->data){
|
||||
lm_error_set(LM_ERR_CtxDataNULL);
|
||||
return false;
|
||||
}
|
||||
|
||||
char dbpath[strlen(ctx->data)+10];
|
||||
join(dbpath, ctx->data, "db");
|
||||
|
||||
|
Reference in New Issue
Block a user