if (!host)
BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot add host comment for non-existent host '" + arguments[0] + "'"));
+ if (arguments[2].IsEmpty() || arguments[3].IsEmpty())
+ BOOST_THROW_EXCEPTION(std::invalid_argument("Author and comment may not be empty"));
+
Log(LogNotice, "ExternalCommandProcessor")
<< "Creating comment for host " << host->GetName();
(void) Comment::AddComment(host, CommentUser, arguments[2], arguments[3], 0);
if (!service)
BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot add service comment for non-existent service '" + arguments[1] + "' on host '" + arguments[0] + "'"));
+ if (arguments[3].IsEmpty() || arguments[4].IsEmpty())
+ BOOST_THROW_EXCEPTION(std::invalid_argument("Author and comment may not be empty"));
+
Log(LogNotice, "ExternalCommandProcessor")
<< "Creating comment for service " << service->GetName();
(void) Comment::AddComment(service, CommentUser, arguments[3], arguments[4], 0);