Skip to content

Commit

Permalink
Fix MyAlerts alert code from crashing
Browse files Browse the repository at this point in the history
  • Loading branch information
Sama34 committed Jun 5, 2020
1 parent 24ba509 commit 2ad98cf
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Upload/inc/plugins/ougc_awards.php
Expand Up @@ -2490,14 +2490,16 @@ function update_task_file($action=1)
if($action == -1)
{
$db->delete_query('tasks', "file='ougc_awards'");

return;
}

$query = $db->simple_select('tasks', '*', "file='ougc_awards'", array('limit' => 1));
$task = $db->fetch_array($query);

if($task)
{
$db->update_query('tasks', array('enabled' => $action), $where);
$db->update_query('tasks', array('enabled' => $action), "file='ougc_awards'");
}
else
{
Expand Down Expand Up @@ -3645,7 +3647,7 @@ function send_alert($type='give_award')
global $lang, $mybb, $alertType, $db;
$this->lang_load(true);

if(!$this->myalerts)
if(!($this->myalerts && class_exists('MybbStuff_MyAlerts_AlertTypeManager')))
{
return false;
}
Expand Down

0 comments on commit 2ad98cf

Please sign in to comment.