Skip to content

Commit

Permalink
Added check for if range exists when getting progress for resumable u…
Browse files Browse the repository at this point in the history
…pload. (#1209)
  • Loading branch information
ytn3rd authored and bshaffer committed Jun 29, 2017
1 parent bb58ef5 commit 7c17a71
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Google/Http/MediaFileUpload.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,11 @@ private function makePutRequest(RequestInterface $request)

if (308 == $this->httpResultCode) {
// Track the amount uploaded.
$range = explode('-', $response->getHeaderLine('range'));
$this->progress = $range[1] + 1;
$range = $response->getHeaderLine('range');
if ($range) {
$range_array = explode('-', $range);
$this->progress = $range_array[1] + 1;
}

// Allow for changing upload URLs.
$location = $response->getHeaderLine('location');
Expand Down

0 comments on commit 7c17a71

Please sign in to comment.