diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-03-30 21:10:18 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-03-30 21:10:18 +0300 |
commit | 2c9c1e2eb8e74a6f8d9765993365648555ddf9b0 (patch) | |
tree | b2f83e8dda892954898205526bd0d4796ba52641 /src/emap/craftconf.c | |
parent | b826af28255cbd69318929aeb06b4164feed5588 (diff) | |
download | evol-hercules-2c9c1e2eb8e74a6f8d9765993365648555ddf9b0.tar.gz evol-hercules-2c9c1e2eb8e74a6f8d9765993365648555ddf9b0.tar.bz2 evol-hercules-2c9c1e2eb8e74a6f8d9765993365648555ddf9b0.tar.xz evol-hercules-2c9c1e2eb8e74a6f8d9765993365648555ddf9b0.zip |
Add missing checks.
Diffstat (limited to 'src/emap/craftconf.c')
-rw-r--r-- | src/emap/craftconf.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/emap/craftconf.c b/src/emap/craftconf.c index ecab0ac..f4e52bd 100644 --- a/src/emap/craftconf.c +++ b/src/emap/craftconf.c @@ -77,7 +77,7 @@ static int craft_get_item_id(struct craft_db_entry *entry, const char *const name, const char *const fieldName) { - if (!strcmp(name, "Empty")) + if (!strcmp(name, "Empty") || !entry || !errorMessage) return 0; struct item_data* id = itemdb->search_name(name); @@ -94,7 +94,7 @@ static void craft_read_source_inventory(struct craft_db_entry *entry, { int i32; int i = 0; - if (!tt || !config_setting_is_group(tt)) + if (!entry || !tt || !config_setting_is_group(tt)) return; struct config_setting_t *item; @@ -139,7 +139,7 @@ static void craft_read_create_items(struct craft_db_entry *entry, { int i32; int i = 0; - if (!tt || !config_setting_is_group(tt)) + if (!entry || !tt || !config_setting_is_group(tt)) return; struct config_setting_t *item; @@ -190,7 +190,7 @@ static void craft_read_items_collection(struct craft_db_entry *entry, { int i32; int i = 0; - if (!t) + if (!entry || !t || !vector) return; struct config_setting_t *tt = libconfig->setting_get_member(t, fieldName); |