mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-16 17:30:43 -07:00
Merge pull request #1760 from mtasaka/nil-nil-comparison-fix
change: make nil_safe_casecmp judge compatible for nil-nil comparison
This commit is contained in:
@@ -944,6 +944,8 @@ module Liquid
|
||||
def nil_safe_casecmp(a, b)
|
||||
if !a.nil? && !b.nil?
|
||||
a.to_s.casecmp(b.to_s)
|
||||
elsif a.nil? && b.nil?
|
||||
0
|
||||
else
|
||||
a.nil? ? 1 : -1
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user