Skip to content

Commit

Permalink
fix possible NPE
Browse files Browse the repository at this point in the history
  • Loading branch information
rpanak-generalbytes committed Oct 9, 2020
1 parent bf3f9c4 commit 5b52404
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@

import io.everytrade.server.parser.exchange.EveryTradeApiTransactionBean;

import java.util.ArrayList;
import java.util.List;

public class EveryTradeApiDto {
private String[] header; //TODO: remove header?
private List<EveryTradeApiTransactionBean> transactions;
private List<EveryTradeApiTransactionBean> transactions = new ArrayList<>();

public EveryTradeApiDto() {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ public DownloadResult getTransactions(String lastTransactionId) {
final EveryTradeApiDto data =
api.getTransactions(apiKey, signer, lastTransactionId, MAX_FETCH_SIZE);

final List<EveryTradeApiTransactionBean> transactions = data.getTransactions();
final List<EveryTradeApiTransactionBean> transactions
= Objects.requireNonNullElse(data.getTransactions(), new ArrayList<>());

final List<ImportedTransactionBean> importedTransactions = new ArrayList<>();
final List<RowError> errorRows = new ArrayList<>();
Expand Down

0 comments on commit 5b52404

Please sign in to comment.