]> git.donarmstrong.com Git - infobot.git/commitdiff
check if $age is NULL in &isStale()
authordms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Wed, 31 Jan 2001 13:26:38 +0000 (13:26 +0000)
committerdms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Wed, 31 Jan 2001 13:26:38 +0000 (13:26 +0000)
git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk@285 c11ca15a-4712-0410-83d8-924469b57eb5

blootbot/src/Misc.pl

index fe89197c18cb6a6e48cf614ffff09869f0eadc25..22cd0ea571df8f3d9379fad3662d273e10d783dc 100644 (file)
@@ -427,6 +427,11 @@ sub IsHostMatch {
 sub isStale {
     my ($file, $age) = @_;
 
+    if (!defined $age) {
+       &WARN("isStale: age == NULL.");
+       return 1;
+    }
+
     return 1 unless ( -f $file);
     return 1 if (time() - (stat($file))[9] > $age*60*60*24);
     my $delta = time() - (stat($file))[9];