mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2024-11-07 03:07:26 +01:00
Prevent a potential parsing error using the gfycat API.
This commit is contained in:
parent
f17350cc1d
commit
54ef23c357
@ -104,7 +104,12 @@ public class FetchGfycatOrRedgifsVideoLinks {
|
||||
.getJSONObject(JSONUtils.CONTENT_URLS_KEY)
|
||||
.getJSONObject(JSONUtils.WEBM_KEY)
|
||||
.getString(JSONUtils.URL_KEY);
|
||||
mp4 = jsonObject.getJSONObject(JSONUtils.GFY_ITEM_KEY).getString(JSONUtils.MP4_URL_KEY);
|
||||
mp4 = jsonObject.getJSONObject(JSONUtils.GFY_ITEM_KEY).has(JSONUtils.MP4_URL_KEY) ?
|
||||
jsonObject.getJSONObject(JSONUtils.GFY_ITEM_KEY).getString(JSONUtils.MP4_URL_KEY)
|
||||
: jsonObject.getJSONObject(JSONUtils.GFY_ITEM_KEY)
|
||||
.getJSONObject(JSONUtils.CONTENT_URLS_KEY)
|
||||
.getJSONObject(JSONUtils.MP4_KEY)
|
||||
.getString(JSONUtils.URL_KEY);
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
parseFailed = true;
|
||||
|
Loading…
Reference in New Issue
Block a user