]> git.donarmstrong.com Git - infobot.git/commitdiff
added checking of NULL rhs just in case.
authordms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Mon, 15 Jan 2001 13:11:28 +0000 (13:11 +0000)
committerdms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Mon, 15 Jan 2001 13:11:28 +0000 (13:11 +0000)
git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@241 c11ca15a-4712-0410-83d8-924469b57eb5

src/Factoids/Update.pl

index 334a72b5928af738f26734d5d606029793453d46..9b5c963fbca446d475b4c77fa7975225f8a54b7c 100644 (file)
@@ -119,6 +119,10 @@ sub update {
            &status("update: <$who> \'$lhs\' =$mhs=> \'$rhs\'; was \'$exists\'");
            &AddModified($lhs,$nuh);
            &setFactInfo($lhs, "factoid_value", $rhs);
+
+           if (!defined $rhs or $rhs eq "") {
+               &ERROR("Update: rhs1 == NULL.");
+           }
        } else {                                # not "also"
            if ($correction_plausible) {        # "no, blah is ..."
                my $author = &getFactInfo($lhs, "created_by") || "";
@@ -137,6 +141,11 @@ sub update {
                &setFactInfo($lhs,"created_by", $nuh);
                &setFactInfo($lhs,"created_time", time());
                &setFactInfo($lhs,"factoid_value", $rhs);
+
+               if (!defined $rhs or $rhs eq "") {
+                   &ERROR("Update: rhs1 == NULL.");
+               }
+
            } else {                     # "blah is ..."
                if ($addressed) {
                    &performStrictReply("...but \002$lhs\002 is already something else...");
@@ -162,6 +171,10 @@ sub update {
        &setFactInfo($lhs,"created_by", $nuh);
        &setFactInfo($lhs,"created_time", time());
        &setFactInfo($lhs,"factoid_value", $rhs);
+
+       if (!defined $rhs or $rhs eq "") {
+           &ERROR("Update: rhs1 == NULL.");
+       }
     }
 
     return "$lhs $mhs $rhs";