FIX: remove nil items before sorting the sha1 string array. (#18571)

Previously, when the array had both nil and string values it returned the error "comparison of NilClass with String failed". Now I added the `.compact` method to prevent this issue as per @martin-brennan's suggestion https://github.com/discourse/discourse/pull/18431#discussion_r984204788
This commit is contained in:
Vinoth Kannan
2022-10-13 02:43:56 +05:30
committed by GitHub
parent 0fe111e492
commit 7f167de10b
2 changed files with 11 additions and 1 deletions

View File

@ -225,7 +225,7 @@ class Stylesheet::Manager::Builder
sha1s << upload_field.upload&.sha1
end
Digest::SHA1.hexdigest(sha1s.sort!.join("\n"))
Digest::SHA1.hexdigest(sha1s.compact.sort!.join("\n"))
end
def default_digest