codefog / contao-instagram

Contao extension that displays Instagram feed on your website
MIT License
11 stars 12 forks source link

Handle RequestException for empty/invalid media data #39

Closed rabauss closed 2 years ago

rabauss commented 2 years ago

As discussed on slack (https://contao.slack.com/archives/CLTUNH78X/p1657699418985049), there might be a problem if instagram answers with empty media data.

The $url is not set here: https://github.com/codefog/contao-instagram/blob/ceb8df7721f66080aa7974600e9543bd5df3588a/src/InstagramClient.php#L131-L137

The empty $url leads to a GuzzleHttp\Exception\RequestException which is not catched here: https://github.com/codefog/contao-instagram/blob/ceb8df7721f66080aa7974600e9543bd5df3588a/src/InstagramClient.php#L150

The exception should be catched and/or empty $url should be handled

qzminski commented 2 years ago

Should be fixed in 7ee34b1 and 2.3.4 :+1: Thank you @rabauss for investigating this!