From d04cf98e5c0c416a19627f49d23c1df5004076dd Mon Sep 17 00:00:00 2001 From: Constantine Date: Sat, 10 Mar 2012 15:53:07 +0400 Subject: [PATCH] Fix undefined array index notice exception from being thrown while getting size of one-file torrent --- vendor/torrent/lib/Torrent/src/Torrent.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/torrent/lib/Torrent/src/Torrent.php b/vendor/torrent/lib/Torrent/src/Torrent.php index f11d55f..81560ea 100644 --- a/vendor/torrent/lib/Torrent/src/Torrent.php +++ b/vendor/torrent/lib/Torrent/src/Torrent.php @@ -638,7 +638,7 @@ public function offset () { */ public function size ( $precision = null ) { $size = 0; - if ( is_array( $this->info['files'] ) ) + if ( isset($this->info['files']) && is_array( $this->info['files'] ) ) foreach ( $this->info['files'] as $file ) $size += $file['length']; elseif ( isset( $this->info['name'] ) )