Skip to content

Commit 78acdeb

Browse files
committed
fixed break condition for failed requests
1 parent d291ae3 commit 78acdeb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/Redmine/Api/AbstractApi.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,11 @@ protected function retrieveAll($endpoint, array $params = array())
123123
$offset += $_limit;
124124
// Break if the data set is the last one, as the offset is greater
125125
// than the total count
126-
if ($newDataSet['offset'] >= $newDataSet['total_count']) {
126+
if (empty($newDataSet)
127+
|| (array_key_exists('offset', $newDataSet)
128+
&& array_key_exists('total_count', $newDataSet)
129+
&& $newDataSet['offset'] >= $newDataSet['total_count'])
130+
) {
127131
$limit = 0;
128132
}
129133
}

0 commit comments

Comments
 (0)