summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--parser/widget_plugin_parser_db.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/parser/widget_plugin_parser_db.c b/parser/widget_plugin_parser_db.c
index 2af8a9a..88cc4dc 100644
--- a/parser/widget_plugin_parser_db.c
+++ b/parser/widget_plugin_parser_db.c
@@ -78,12 +78,17 @@ static int _insert_support_size(sqlite3 *db, const char *pkgid,
idx = 1;
_bind_text(stmt, idx++, classid);
/* adjust preview image path */
- if (size->preview[0] == '/')
- snprintf(buf, sizeof(buf), "%s", size->preview);
- else
- snprintf(buf, sizeof(buf), "%s/shared/res/%s",
- _get_root_path(pkgid), size->preview);
- _bind_text(stmt, idx++, buf);
+ if (size->preview != NULL) {
+ if (size->preview[0] == '/')
+ snprintf(buf, sizeof(buf), "%s", size->preview);
+ else
+ snprintf(buf, sizeof(buf), "%s/shared/res/%s",
+ _get_root_path(pkgid),
+ size->preview);
+ _bind_text(stmt, idx++, buf);
+ } else {
+ _bind_text(stmt, idx++, NULL);
+ }
sqlite3_bind_int(stmt, idx++, size->frame);
sqlite3_bind_int(stmt, idx++, size->width);
sqlite3_bind_int(stmt, idx++, size->height);