]> git.mjollnir.org Git - cil.git/commitdiff
Workaround for older versions of DateTime
authorSam Vilain <sam.vilain@catalyst.net.nz>
Sun, 22 Jun 2008 23:40:27 +0000 (11:40 +1200)
committerSam Vilain <sam.vilain@catalyst.net.nz>
Sun, 22 Jun 2008 23:40:27 +0000 (11:40 +1200)
Older versions of DateTime blow up if you try to compare them to
anything - even just testing equality they will raise an exception.
So, guard this comparison in an eval { }.

lib/CIL/Base.pm

index f90dcca58cf5564aa61926ea70495057e793a59f..ed5c3a81ce0e35617009ea5cda62e4e115e83be6 100644 (file)
@@ -125,7 +125,7 @@ sub set {
 
     # finish if both are defined and they're the same
     if ( defined $orig and defined $value ) {
-        return if $orig eq $value
+        return if eval { $orig eq $value };
     }
 
     # finish if neither are defined