mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 12:51:24 +08:00
#compact! can return nil if no changes were made
This commit is contained in:
@ -22,6 +22,7 @@ module MemoryDiagnostics
|
|||||||
diff = diff.map do |id|
|
diff = diff.map do |id|
|
||||||
ObjectSpace._id2ref(id) rescue nil
|
ObjectSpace._id2ref(id) rescue nil
|
||||||
end.compact!
|
end.compact!
|
||||||
|
diff ||= []
|
||||||
|
|
||||||
report = "#{diff.length} objects have leaked\n"
|
report = "#{diff.length} objects have leaked\n"
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user