Skip to content

Commit 63fdb08

Browse files
committed
KRF-312 #fix Fixed minor bugs that allowed calling methods on nulls in Event and Loop API
1 parent e0760b1 commit 63fdb08

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

Model/SelectLoop.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,10 @@ public function addPeriodicTimer($interval, callable $callback)
206206
*/
207207
public function cancelTimer(TimerInterface $timer)
208208
{
209-
$this->timers->remove($timer);
209+
if (isset($this->timers))
210+
{
211+
$this->timers->remove($timer);
212+
}
210213
}
211214

212215
/**

Timer/Timer.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,9 @@ public function isActive()
138138
*/
139139
public function cancel()
140140
{
141-
$this->loop->cancelTimer($this);
141+
if (isset($this->loop))
142+
{
143+
$this->loop->cancelTimer($this);
144+
}
142145
}
143146
}

0 commit comments

Comments
 (0)