json: Allow NULL request in encode and chunk

* src/gpgme-json.c (encode_and_chunk): Don't error on NULL
request.

--
This fixes the error that is passed when parthing the json
object failed and request would be NULL.
Instead of the JSON parser error it would otherwise report
that encode and chunk failed.
This commit is contained in:
Andre Heinecke 2018-08-28 08:05:30 +02:00
parent 8aa61fd3a2
commit 7d3c13df26
No known key found for this signature in database
GPG Key ID: 2978E9D40CBABA5C

View File

@ -1521,7 +1521,7 @@ encode_and_chunk (cjson_t request, cjson_t response)
{
char *data;
gpg_error_t err = 0;
size_t chunksize;
size_t chunksize = 0;
char *getmore_request = NULL;
if (opt_interactive)
@ -1537,7 +1537,6 @@ encode_and_chunk (cjson_t request, cjson_t response)
if (!request)
{
err = GPG_ERR_INV_VALUE;
goto leave;
}