move pointer test to generic helper

This should always be tested for - the only other user of the generic
helper currently didn't test for it, either.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2022-05-31 14:36:14 -07:00
parent 0aad8cfd13
commit 7c3e92e391
2 changed files with 3 additions and 3 deletions

View File

@ -71,6 +71,9 @@ dc_status_t dc_field_get_string(dc_field_cache_t *cache, unsigned idx, dc_field_
dc_status_t
dc_field_get(dc_field_cache_t *cache, dc_field_type_t type, unsigned int flags, void* value)
{
if (!value)
return DC_STATUS_INVALIDARGS;
if (!(cache->initialized & (1 << type)))
return DC_STATUS_UNSUPPORTED;

View File

@ -1489,9 +1489,6 @@ garmin_parser_get_field (dc_parser_t *abstract, dc_field_type_t type, unsigned i
{
garmin_parser_t *garmin = (garmin_parser_t *) abstract;
if (!value)
return DC_STATUS_INVALIDARGS;
return dc_field_get(&garmin->cache, type, flags, value);
}