summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMalf Furious <m@lfurio.us>2018-07-22 02:25:54 -0400
committerMalf Furious <m@lfurio.us>2018-07-22 02:25:54 -0400
commit3eaf6f3b990d86069453b1bda4ed377e67ccf571 (patch)
tree0602bad5eebb72528c94db87070885c810d92b04
parent7a758b2ffcc43f64bfddfb252441f56e0c032089 (diff)
downloadscrott-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.php5
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;
}
/*