fix: add ctx data dir check for database initialization

This commit is contained in:
ngn 2024-07-14 21:07:25 +03:00
parent 9aefa2ebf9
commit 16cfc0676e
2 changed files with 6 additions and 1 deletions

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-07-14 18:02+0300\n"
"POT-Creation-Date: 2024-07-14 21:05+0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"

View File

@ -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");