diff --git a/models/claim.js b/models/claim.js index 090bbaa2..5ec31da7 100644 --- a/models/claim.js +++ b/models/claim.js @@ -58,8 +58,10 @@ function determineOgDescription (storedDescription, defaultDescription) { }; function determineOgThumbnailContentType (thumbnail) { - if (thumbnail.lastIndexOf('.') !== -1) { - return determineContentTypeFromFileExtension(thumbnail.substring(thumbnail.lastIndexOf('.'))); + if (thumbnail) { + if (thumbnail.lastIndexOf('.') !== -1) { + return determineContentTypeFromFileExtension(thumbnail.substring(thumbnail.lastIndexOf('.'))); + } } return ''; }