Check for error
FossilOrigin-Name: f006d7df58bb3a566f956dddc2ae79493758b422afea5dee3da8982e15c2de4a
This commit is contained in:
parent
15fa13b86c
commit
2c509d650c
3 changed files with 4 additions and 3 deletions
|
@ -33,7 +33,7 @@ int _mstdnt_key_val_ref(cJSON* v, struct _mstdnt_val_ref* refs,
|
|||
size_t i;
|
||||
for (i = 0; i < refs_len; ++i)
|
||||
{
|
||||
if (strcmp(refs[i].key, v->string) == 0)
|
||||
if (v->string && strcmp(refs[i].key, v->string) == 0)
|
||||
{
|
||||
refs[i].handle(v, refs[i].val);
|
||||
return 0;
|
||||
|
|
|
@ -42,13 +42,11 @@ int mastodont_request(mastodont_t* data, struct mastodont_request_args* args)
|
|||
goto cleanup;
|
||||
}
|
||||
|
||||
/*
|
||||
if (mstdnt_check_error(&results, storage))
|
||||
{
|
||||
res = 1;
|
||||
goto cleanup_res;
|
||||
}
|
||||
*/
|
||||
|
||||
/* Optional */
|
||||
if (args->callback) args->callback(&results, storage, args->args);
|
||||
|
|
|
@ -85,6 +85,9 @@ int mstdnt_status_from_result(struct mstdnt_fetch_results* results,
|
|||
struct mstdnt_storage* storage,
|
||||
struct mstdnt_status* status)
|
||||
{
|
||||
/* Can be null sometimes */
|
||||
if (!status) return 0;
|
||||
|
||||
cJSON* root;
|
||||
if (_mstdnt_json_init(&root, results, storage) ||
|
||||
!cJSON_IsObject(root))
|
||||
|
|
Loading…
Reference in a new issue