You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
👉 Presenter with component that can return null under specific conditions.
// exprecting null being stored in $var$var = $presenter->getComponent('ControlOrNull', false);
// exception is being thrown in Nette\ComponentModel\Container::createComponent method
Despite setting $throw to false, exception is thrown.
Steps To Reproduce
class MyPresenter extends Presenter {
publicfunctioncreateComponentControlOrNull(): ?Form
{
returnnull;
}
}
$val = $presenter->getComponent('ControlOrNull', false); // no exception should be thrown$vall === true; // should equal true
Expected Behavior
I am able to return null value from createComponent* methods.
Possible Solution
$throw property should be propagated to Nette\ComponentModel\Container::createComponent method.
The text was updated successfully, but these errors were encountered:
Version: 3.1.2
Bug Description
👉 Presenter with component that can return
null
under specific conditions.Despite setting
$throw
tofalse
, exception is thrown.Steps To Reproduce
Expected Behavior
I am able to return
null
value fromcreateComponent*
methods.Possible Solution
$throw
property should be propagated toNette\ComponentModel\Container::createComponent
method.The text was updated successfully, but these errors were encountered: