Twitch API-- Accessing Logo Offline

Hi, I am almost done with my Twitch API Project, but I don’t understand how the example codepen was able to get the FreeCodeCamp Logo to display even when FCC is offline.

The Twitch API documentation seems to indicate that, when a channel is offline, the api returns{ "stream":null }
which I would think would make data.stream.channel.logo return an error. However, the example codepen seems to be able to access this property even when offline.

Thanks!

If you look at the code again, you will notice a second $.getJSON to get the logo image using the channels endpoint instead of the streams endpoint as the first $.getJSON uses.

Thanks! That makes a lot of sense.