don't die if result_source_instance is not available on thaw in Serialize::Storable
David Kamholz [Sun, 12 Feb 2006 14:53:38 +0000 (14:53 +0000)]
lib/DBIx/Class/Serialize/Storable.pm

index 48c4597..8066337 100644 (file)
@@ -12,7 +12,7 @@ sub STORABLE_freeze {
 sub STORABLE_thaw {
     my ($self,$cloning,$serialized) = @_;
     %$self = %{ Storable::thaw($serialized) };
-    $self->result_source($self->result_source_instance);
+    $self->result_source($self->result_source_instance) if $self->can('result_source_instance');
 }
 
 1;