Skip to content
This repository was archived by the owner on Oct 7, 2021. It is now read-only.

Commit 51394e1

Browse files
committed
Merge pull request #2 from natgeo/fix-srcset-edgecase
Fix edge case where souce element has no srcsets
2 parents 1fbed4d + 2ea9c61 commit 51394e1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pictureTime.coffee

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ pictureTime = ->
4444

4545
srcSets = matches.pop().getAttribute "srcset"
4646

47-
if srcSets
47+
if srcSets and srcSets.length
4848
if deviceRatio and srcSets.indexOf( " 2x" ) isnt -1
4949
srcSets = srcSets.split ","
5050
for src in srcSets

pictureTime.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)