Skip to content

Commit

Permalink
dont check screenshots property
Browse files Browse the repository at this point in the history
  • Loading branch information
lluisd committed May 18, 2024
1 parent 727896c commit bfd18be
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ mongoose.connect(config.database).then(() => {

app.get('/stream', function(req, res) {
TwitchService.getChannel().then(async (channel) => {
if (channel && channel.streamId) {
if (channel) {
const screenshots = await ScreenshotService.getScreenshots(channel.streamId)
res.render('pages/stream',{
screenshots: screenshots,
Expand All @@ -81,7 +81,7 @@ mongoose.connect(config.database).then(() => {

app.get('/i/:id', (req, res) => {
TwitchService.getChannel().then(async (channel) => {
if (channel && channel.streamId) {
if (channel) {
const screenshots = await ScreenshotService.getScreenshots(channel.streamId)
if (screenshots.length > 0) {
const image = screenshots.find((s) => s.name === req.params.id)
Expand Down

0 comments on commit bfd18be

Please sign in to comment.