Skip to content

Commit

Permalink
Fix undefined array index notice exception from being thrown while ge…
Browse files Browse the repository at this point in the history
…tting size of one-file torrent
  • Loading branch information
Constantine authored and Constantine committed Mar 10, 2012
1 parent d9d41fd commit d04cf98
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vendor/torrent/lib/Torrent/src/Torrent.php
Expand Up @@ -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'] ) )
Expand Down

0 comments on commit d04cf98

Please sign in to comment.