diff --git a/app/controllers/oer/admin.php b/app/controllers/oer/admin.php index ac65d3fe58a29133ecc396b20a8a5909ad7806d1..11b8266b759ff980427f2c684e5a8506d0dc69ed 100644 --- a/app/controllers/oer/admin.php +++ b/app/controllers/oer/admin.php @@ -136,8 +136,8 @@ class Oer_AdminController extends AuthenticatedController public function toggle_server_active_action() { if (Request::isPost()) { - $host = new OERHost(Request::option("host_id")); - if (!$host->isMe()) { + $host = OERHost::find(Request::option("host_id")); + if ($host && !$host->isMe()) { $host['active'] = Request::int("active", 0); $host->store(); }