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 52d000b6f9
commit 0be938b4a7

View File

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