mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -08:00
Merge pull request #13571 from inietov/fixes/require_acceptance_on_null
Fixed Attempt to read property require_acceptance on null [rollbar-3557]
This commit is contained in:
commit
67cad9c751
|
@ -323,7 +323,10 @@ class License extends Depreciable
|
||||||
*/
|
*/
|
||||||
public function checkin_email()
|
public function checkin_email()
|
||||||
{
|
{
|
||||||
return $this->category->checkin_email;
|
if ($this->category) {
|
||||||
|
return $this->category->checkin_email;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -335,7 +338,11 @@ class License extends Depreciable
|
||||||
*/
|
*/
|
||||||
public function requireAcceptance()
|
public function requireAcceptance()
|
||||||
{
|
{
|
||||||
return $this->category->require_acceptance;
|
if ($this->category) {
|
||||||
|
return $this->category->require_acceptance;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -348,14 +355,16 @@ class License extends Depreciable
|
||||||
*/
|
*/
|
||||||
public function getEula()
|
public function getEula()
|
||||||
{
|
{
|
||||||
|
if ($this->category){
|
||||||
if ($this->category->eula_text) {
|
if ($this->category->eula_text) {
|
||||||
return Helper::parseEscapedMarkedown($this->category->eula_text);
|
return Helper::parseEscapedMarkedown($this->category->eula_text);
|
||||||
} elseif ($this->category->use_default_eula == '1') {
|
} elseif ($this->category->use_default_eula == '1') {
|
||||||
return Helper::parseEscapedMarkedown(Setting::getSettings()->default_eula_text);
|
return Helper::parseEscapedMarkedown(Setting::getSettings()->default_eula_text);
|
||||||
} else {
|
}
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -48,7 +48,10 @@ class LicenseSeat extends SnipeModel implements ICompanyableChild
|
||||||
*/
|
*/
|
||||||
public function requireAcceptance()
|
public function requireAcceptance()
|
||||||
{
|
{
|
||||||
return $this->license->category->require_acceptance;
|
if ($this->license && $this->license->category) {
|
||||||
|
return $this->license->category->require_acceptance;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getEula()
|
public function getEula()
|
||||||
|
|
Loading…
Reference in a new issue