karma fix

This commit is contained in:
kremsy 2014-02-24 09:11:48 +01:00 committed by Steffen Schröder
parent 1a366dcb50
commit 80ccc1a838

View File

@ -145,7 +145,7 @@ class KarmaPlugin implements CallbackListener, TimerListener, Plugin {
* @see \ManiaControl\Plugins\Plugin::getAuthor()
*/
public static function getAuthor() {
return 'steeffeen';
return 'steeffeen and kremsy';
}
/**
@ -603,7 +603,7 @@ class KarmaPlugin implements CallbackListener, TimerListener, Plugin {
return;
}
if (count($this->mxKarma['votes']) == 0) {
if (!isset($this->mxKarma['votes']) || count($this->mxKarma['votes']) == 0) {
return;
}
@ -633,7 +633,6 @@ class KarmaPlugin implements CallbackListener, TimerListener, Plugin {
$this->maniaControl->fileReader->postData(self::MX_KARMA_URL . self::MX_KARMA_SAVEVOTES . "?sessionKey=" . urlencode($this->mxKarma['session']->sessionKey), function ($data, $error) {
if (!$error) {
$data = json_decode($data);
var_dump($data);
if ($data->success) {
$this->maniaControl->log("Votes successfully permitted");
} else {