From 48a1862ef7c85081a622e488665644bd2f6c16c3 Mon Sep 17 00:00:00 2001 From: Tom Gilbert Date: Mon, 12 Dec 2005 15:44:30 +0000 Subject: [PATCH] try to handle backwards compat issues --- lib/rbot/registry.rb | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/lib/rbot/registry.rb b/lib/rbot/registry.rb index 5228d223..2a7edbb6 100644 --- a/lib/rbot/registry.rb +++ b/lib/rbot/registry.rb @@ -120,7 +120,20 @@ module Irc # val # end def restore(val) - Marshal.restore(val) + begin + Marshal.restore(val) + rescue + $stderr.puts "failed to restore marshal data, falling back to default" + if @default != nil + begin + return Marshal.restore(@default) + rescue + return nil + end + else + return nil + end + end end # lookup a key in the registry -- 2.39.5