From 0d427314512d71e681e6a7cc8de293c40cf6d42a Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Fri, 23 Feb 2007 01:48:55 +0000 Subject: Only write to stream if it is open. --- etc/inc/pkg-utils.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'etc/inc/pkg-utils.inc') diff --git a/etc/inc/pkg-utils.inc b/etc/inc/pkg-utils.inc index 96f928f..ae1fd87 100644 --- a/etc/inc/pkg-utils.inc +++ b/etc/inc/pkg-utils.inc @@ -350,7 +350,8 @@ function download_file_with_progress_bar($url_file, $destination_file) { curl_exec($ch); $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); - fclose($fout); + if($fout) + fclose($fout); curl_close($ch); return ($http_code == 200) ? true : $http_code; } -- cgit v1.1