Block: Avoid NPE in hasTransactions()

Field is nullable;

```java
@Nullable List<Transaction> transactions;
```
This commit is contained in:
Daniel James
2017-12-25 18:18:14 -08:00
committed by Andreas Schildbach
parent b6415663c9
commit 73fe9e6ab5

View File

@@ -1002,7 +1002,7 @@ public class Block extends Message {
* purely a header).
*/
public boolean hasTransactions() {
return !this.transactions.isEmpty();
return (this.transactions != null) && !this.transactions.isEmpty();
}
/**