diff --git a/album-songs.lua b/album-songs.lua index 5fb68bb..7f26a10 100644 --- a/album-songs.lua +++ b/album-songs.lua @@ -40,8 +40,7 @@ local res, code, response_headers, status, json_response, data = ampacheHttp.mak }) -- Check if the request was successful -if code == 200 then - +if code == 200 and data ~= nil then -- if the -j option is passed, just print the json file if is_json_output == true then print(json_response) diff --git a/albums.lua b/albums.lua index cead4b7..75e8c24 100644 --- a/albums.lua +++ b/albums.lua @@ -40,7 +40,7 @@ local res, code, response_headers, status, json_response, data = filterValue = filter_value }) -if code == 200 then +if code == 200 and data ~= nil then -- if the -j option is passed, just print the json file if is_json_output == true then print(json_response)