mirror of
https://github.com/Seldaek/monolog.git
synced 2025-10-23 01:26:11 +02:00
Fixed an error when close() is called with an invalid resource.
This commit is contained in:
@@ -44,6 +44,7 @@ class StreamHandler extends AbstractHandler
|
|||||||
}
|
}
|
||||||
$this->stream = fopen($this->url, 'a');
|
$this->stream = fopen($this->url, 'a');
|
||||||
if (!is_resource($this->stream)) {
|
if (!is_resource($this->stream)) {
|
||||||
|
$this->stream = null;
|
||||||
throw new \UnexpectedValueException('The stream could not be opened, "'.$this->url.'" may be an invalid url.');
|
throw new \UnexpectedValueException('The stream could not be opened, "'.$this->url.'" may be an invalid url.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user