From 6c172a30d3165eeaf6e13006c06441c29a41f3ab Mon Sep 17 00:00:00 2001 From: Carson Reinke Date: Tue, 27 Oct 2015 12:14:18 -0400 Subject: [PATCH] #compact! can return nil if no changes were made --- lib/memory_diagnostics.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/memory_diagnostics.rb b/lib/memory_diagnostics.rb index d79d84407..e484bf512 100644 --- a/lib/memory_diagnostics.rb +++ b/lib/memory_diagnostics.rb @@ -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"