diff --git a/src-shared/thumbnail/cache/thumbnail-cache-util.ts b/src-shared/thumbnail/cache/thumbnail-cache-util.ts index 97be5939..f222b072 100644 --- a/src-shared/thumbnail/cache/thumbnail-cache-util.ts +++ b/src-shared/thumbnail/cache/thumbnail-cache-util.ts @@ -138,7 +138,14 @@ export function lastModifiedMatchBetweenSrcFileAndThumbnailGenerationLogFile(src return false; } - const fileContentObj = JSON.parse(fileContentStr); + let fileContentObj; + try { + fileContentObj = JSON.parse(fileContentStr); + } catch (error) { + Logger.error(`Failed to parse the content of the log file "${logFilePath}" as JSON format. The log file is for thumbnail generation result of "${srcFilePath}". error: ${error}`, error); + return false; + } + const lastModifiedFromLogFile = fileContentObj[lastModifiedKey]; if (!lastModifiedFromLogFile) return false;