mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-17 04:06:54 +00:00
TimingsHandler: throw on attempt to stop timer that is not running
I do not think that this bug is in effect in the core code, but I can't be sure.
This commit is contained in:
@@ -168,6 +168,9 @@ class TimingsHandler{
|
|||||||
|
|
||||||
public function stopTiming(){
|
public function stopTiming(){
|
||||||
if(self::$enabled){
|
if(self::$enabled){
|
||||||
|
if($this->timingDepth === 0){
|
||||||
|
throw new \InvalidStateException("Cannot stop a timer that is not running");
|
||||||
|
}
|
||||||
if(--$this->timingDepth !== 0 or $this->start == 0){
|
if(--$this->timingDepth !== 0 or $this->start == 0){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user