mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-10-25 07:48:26 -04:00
Make Monitor::Server always return a Server object so we don't have to test for null
This commit is contained in:
1 parent
caedd94f69
commit
2f295a2f55
1 file changed
+5
-1
@@ -299,8 +299,12 @@ public static function getStatuses() {
|
||||
|
||||
public function Server() {
|
||||
if (!property_exists($this, 'Server')) {
|
||||
if ($this->ServerId())
|
||||
if ($this->ServerId()) {
|
||||
$this->{'Server'} = Server::find_one(array('Id'=>$this->{'ServerId'}));
|
||||
if (!$this->{'Server'}) {
|
||||
$this->{'Server'} = new Server();
|
||||
}
|
||||
}
|
||||
if (!property_exists($this, 'Server')) {
|
||||
$this->{'Server'} = new Server();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user