Skip to content

Commit bd68a1d

Browse files
committed
bugfix: rsf
1 parent b6b63f9 commit bd68a1d

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

qiniu/rsf.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,17 @@ function Qiniu_RSF_ListPrefix(
2727

2828
$url = $QINIU_RSF_HOST . '/list?' . http_build_query($query);
2929
list($ret, $err) = Qiniu_Client_Call($self, $url);
30+
if ($err !== null) {
31+
return array(null, '', $err);
32+
}
3033

3134
$items = $ret['items'];
32-
if (!isset($ret['marker'])) {
35+
if (empty($ret['marker'])) {
3336
$markerOut = '';
3437
$err = Qiniu_RSF_EOF;
3538
} else {
3639
$markerOut = $ret['marker'];
3740
}
38-
3941
return array($items, $markerOut, $err);
4042
}
4143

tests/RsfTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function testListPrefix()
1919
{
2020
echo $this->bucket;
2121
list($items, $markerOut, $err) = Qiniu_RSF_ListPrefix($this->client, $this->bucket);
22-
$this->assertEquals($err->Err, Qiniu_RSF_EOF);
22+
$this->assertEquals($err, Qiniu_RSF_EOF);
2323
$this->assertEquals($markerOut, '');
2424

2525
list($items, $markerOut, $err) = Qiniu_RSF_ListPrefix($this->client, $this->bucket, '', '', 1);

0 commit comments

Comments
 (0)