#compact! can return nil if no changes were made

This commit is contained in:
Carson Reinke 2015-10-27 12:14:18 -04:00
parent 5d59e03ed5
commit 6c172a30d3

View file

@ -22,6 +22,7 @@ module MemoryDiagnostics
diff = diff.map do |id|
ObjectSpace._id2ref(id) rescue nil
end.compact!
diff ||= []
report = "#{diff.length} objects have leaked\n"