mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 13:51:18 +08:00
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:
@ -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
|
||||
|
Reference in New Issue
Block a user