SignText: fixed crash when fetching lines of text if not all lines were provided to the constructor

This commit is contained in:
Dylan K. Taylor 2020-06-29 19:35:38 +01:00
parent dae2a4ffce
commit 42f543b405

View File

@ -43,7 +43,10 @@ class SignText{
* @throws \InvalidArgumentException
*/
public function __construct(?array $lines = null){
$this->setLines($lines ?? array_fill(0, self::LINE_COUNT, ""));
$this->lines = array_fill(0, self::LINE_COUNT, "");
if($lines !== null){
$this->setLines($lines);
}
}
/**