mirror of
https://github.com/Seldaek/monolog.git
synced 2025-02-24 06:52:34 +01: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:
parent
ea466fa848
commit
3b54f13e72
@ -46,10 +46,10 @@ class StreamHandler extends AbstractHandler
|
||||
*/
|
||||
public function close()
|
||||
{
|
||||
if (null !== $this->stream) {
|
||||
if (is_resource($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']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user