From 16cfc0676e10b194f6144f7f3ba4c7e6de695935 Mon Sep 17 00:00:00 2001 From: ngn Date: Sun, 14 Jul 2024 21:07:25 +0300 Subject: [PATCH] fix: add ctx data dir check for database initialization --- locale/tr/LC_MESSAGES/libmp.po | 2 +- src/ctx/database.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/locale/tr/LC_MESSAGES/libmp.po b/locale/tr/LC_MESSAGES/libmp.po index 4478003..34bf5fa 100644 --- a/locale/tr/LC_MESSAGES/libmp.po +++ b/locale/tr/LC_MESSAGES/libmp.po @@ -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 \n" "Language-Team: LANGUAGE \n" diff --git a/src/ctx/database.c b/src/ctx/database.c index 5eea083..526f255 100644 --- a/src/ctx/database.c +++ b/src/ctx/database.c @@ -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");