mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-06 13:16:39 +02:00
fixed StreamHandler close
I encounted the case $this->stream = 0 when close method was called, I think the caller condition may be wrong in this case. But stronger check for the $this->stream parameter makes sense I think.
This commit is contained in:
@@ -46,10 +46,10 @@ class StreamHandler extends AbstractHandler
|
|||||||
*/
|
*/
|
||||||
public function close()
|
public function close()
|
||||||
{
|
{
|
||||||
if (null !== $this->stream) {
|
if (is_resource($this->stream)) {
|
||||||
fclose($this->stream);
|
fclose($this->stream);
|
||||||
$this->stream = null;
|
|
||||||
}
|
}
|
||||||
|
$this->stream = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -69,4 +69,4 @@ class StreamHandler extends AbstractHandler
|
|||||||
}
|
}
|
||||||
fwrite($this->stream, (string) $record['message']);
|
fwrite($this->stream, (string) $record['message']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user