summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--database.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/database.go b/database.go
index e40279e..20c135b 100644
--- a/database.go
+++ b/database.go
@@ -259,6 +259,11 @@ func (app *App) deleteOrphanedArticles() error {
func (app *App) saveCategory(article_id int, categories []string) {
for _, category := range categories {
+ if "" == category {
+ log.Warnf("saveCategory: category is empty for article_id: %d", article_id)
+ continue
+ }
+
query := "SELECT id FROM category WHERE name = ?"
row := app.DB.QueryRow(query, category)
var category_id int