diff options
author | Malf Furious <m@lfurio.us> | 2018-07-22 02:25:54 -0400 |
---|---|---|
committer | Malf Furious <m@lfurio.us> | 2018-07-22 02:25:54 -0400 |
commit | 3eaf6f3b990d86069453b1bda4ed377e67ccf571 (patch) | |
tree | 0602bad5eebb72528c94db87070885c810d92b04 /app/class | |
parent | 7a758b2ffcc43f64bfddfb252441f56e0c032089 (diff) | |
download | scrott-3eaf6f3b990d86069453b1bda4ed377e67ccf571.tar.gz scrott-3eaf6f3b990d86069453b1bda4ed377e67ccf571.zip |
Fix bug in function agent::isOwner()
If the argument doesn't have an owner, then an access error is thrown
when we try to do ->guid. Since there is no owner, just return false.
Otherwise, do the comparision as usual.
Diffstat (limited to '')
-rw-r--r-- | app/class/agent.class.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/app/class/agent.class.php b/app/class/agent.class.php index 6d0e20d..b4e6702 100644 --- a/app/class/agent.class.php +++ b/app/class/agent.class.php @@ -37,7 +37,10 @@ abstract class agent extends obj */ public function isOwnerOf(obj $obj) : bool { - return $obj->getOwner()->guid == $this->guid; + if (!($own = $obj->getOwner())) + return false; + + return $own->guid == $this->guid; } /* |