}
if ($member->id == null) {
- //member does not exists!
+ //member does not exist!
$this->flash->addMessage(
'error_detected',
str_replace('%id', $id, _T("No member #%id."))
*/
private function loadParent(): void
{
- if (!$this->_parent instanceof Adherent) {
+ if ($this->_parent !== null && !$this->_parent instanceof Adherent) {
$deps = array_fill_keys(array_keys($this->_deps), false);
$this->_parent = new Adherent($this->zdb, (int)$this->_parent, $deps);
}
public function getEmail(): string
{
$email = $this->_email;
- if (empty($email)) {
+ if (empty($email) && $this->hasParent()) {
$this->loadParent();
$email = $this->parent->email;
}