From ddcea13e23a1e4393efd0bfb92734262f0d0e51b Mon Sep 17 00:00:00 2001 From: dms Date: Mon, 15 Jan 2001 13:11:28 +0000 Subject: [PATCH] added checking of NULL rhs just in case. git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@241 c11ca15a-4712-0410-83d8-924469b57eb5 --- src/Factoids/Update.pl | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/Factoids/Update.pl b/src/Factoids/Update.pl index 334a72b..9b5c963 100644 --- a/src/Factoids/Update.pl +++ b/src/Factoids/Update.pl @@ -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"; -- 2.39.2