Skip to content

Commit

Permalink
[PDI-13909] Fixed NPE in Google Analytics step with paged results
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Burgess committed Jun 5, 2015
1 parent 8815527 commit f6e8392
Showing 1 changed file with 5 additions and 3 deletions.
Expand Up @@ -252,10 +252,12 @@ private List<String> getNextDataEntry() throws KettleException {
} else if ( data.entryIndex >= data.feed.getItemsPerPage() ) {
try {
// query is there, check whether we hit the last entry and re-query as necessary
if ( data.query.getStartIndex() + data.entryIndex <= data.feed.getTotalResults() ) {
// need to query for next page
data.query.setStartIndex( data.query.getStartIndex() + data.entryIndex );
int startIndex = ( data.query.getStartIndex() == null ) ? 0 : data.query.getStartIndex();
int totalResults = ( data.feed.getTotalResults() == null ) ? 0 : data.feed.getTotalResults();

if ( ( startIndex + data.entryIndex ) <= totalResults ) {
// need to query for next page
data.query.setStartIndex( startIndex + data.entryIndex );
data.feed = data.query.execute();
data.entryIndex = 0;
}
Expand Down

0 comments on commit f6e8392

Please sign in to comment.