IcingaException: Only use `vsprintf()` if `$args` given
If the passed message contains a `%`, but no `$args`, `vsprintf()` throws an error.
This commit is contained in:
parent
10d3fb64f9
commit
5000d3117b
|
@ -25,7 +25,12 @@ class IcingaException extends Exception
|
||||||
$exc = $arg;
|
$exc = $arg;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
parent::__construct(vsprintf($message, $args), 0, $exc);
|
|
||||||
|
if (! empty($args)) {
|
||||||
|
$message = vsprintf($message, $args);
|
||||||
|
}
|
||||||
|
|
||||||
|
parent::__construct($message, 0, $exc);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue