Fix 'vsprintf(): Too few arguments' unexisting imported node exception

If the imported node does not exist, no arguments is  passed to BpConfig::addError() by ImportedNode::createFailedNode(). Added 'if' condition in BpConfig::addError() in case no arguments are passed to vsprintf.

refs #234
This commit is contained in:
Ravi Kumar Kempapura Srinivasa 2020-02-26 10:33:50 +01:00 committed by Johannes Meyer
parent 1278480b6e
commit f5166f4348

View file

@ -915,7 +915,9 @@ class BpConfig
{
$args = func_get_args();
array_shift($args);
$msg = vsprintf($msg, $args);
if (! empty($args)) {
$msg = vsprintf($msg, $args);
}
if ($this->throwErrors) {
throw new IcingaException($msg);
}