It’s possible through an import or other means to have images larger than the current max allowed image size in the db.
If this happens the thumbnail generation job will keep running indefinitely trying to download a new copy of the original but discarding it because it is larger than the max_file_size eventually causing this error
Job exception: undefined method path’ for nil:NilClass`
because the newly downloaded image is now nil.
This fix stops the enqueuing of the
GenerateTopicThumbnails job for
all images that happen to be larger than the max image size.