Skip to content

Commit

Permalink
fix: return null for non images (#184)
Browse files Browse the repository at this point in the history
* fix: dont return null for gatsby image data

* fix: return null for unless image mimeType
  • Loading branch information
notrab authored Mar 30, 2021
1 parent 4f91ca0 commit 7593d89
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion gatsby-source-graphcms/src/gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,9 @@ function makeResolveGatsbyImageData(cache) {
{ handle: filename, height, mimeType, width, url, internal },
options
) {
if (!mimeType.includes('image/')) {
if (
!['image/png', 'image/jpg', 'image/jpeg', 'image/tiff'].includes(mimeType)
) {
return null
}

Expand Down

0 comments on commit 7593d89

Please sign in to comment.