prevent errors with non-objects

This commit is contained in:
Steffen Schröder 2014-07-20 00:24:25 +02:00
parent e58bd8648b
commit d079c0a2cc

View File

@ -66,6 +66,7 @@ class DedimaniaPlugin implements CallbackListener, CommandListener, TimerListene
*/ */
/** @var ManiaControl $maniaControl */ /** @var ManiaControl $maniaControl */
private $maniaControl = null; private $maniaControl = null;
// TODO: there are several spots where $dedimaniaData is null - fix those (look for !$this->dedimaniaData)
/** @var DedimaniaData $dedimaniaData */ /** @var DedimaniaData $dedimaniaData */
private $dedimaniaData = null; private $dedimaniaData = null;
private $updateManialink = false; private $updateManialink = false;
@ -841,6 +842,9 @@ class DedimaniaPlugin implements CallbackListener, CommandListener, TimerListene
* @param RecordCallback $callback * @param RecordCallback $callback
*/ */
public function handleFinishCallback(RecordCallback $callback) { public function handleFinishCallback(RecordCallback $callback) {
if (!$this->dedimaniaData || !$this->dedimaniaData->records) {
return;
}
if ($callback->isLegacyCallback) { if ($callback->isLegacyCallback) {
return; return;
} }