forked from Qortal/qortal
Fixed various NPEs when checking statuses of non-existent resources.
This commit is contained in:
parent
5e750b4283
commit
bede5a71f8
@ -143,6 +143,9 @@ public class ArbitraryDataResource {
|
|||||||
public boolean delete() {
|
public boolean delete() {
|
||||||
try {
|
try {
|
||||||
this.fetchTransactions();
|
this.fetchTransactions();
|
||||||
|
if (this.transactions == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
List<ArbitraryTransactionData> transactionDataList = new ArrayList<>(this.transactions);
|
List<ArbitraryTransactionData> transactionDataList = new ArrayList<>(this.transactions);
|
||||||
|
|
||||||
@ -198,6 +201,9 @@ public class ArbitraryDataResource {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
this.fetchTransactions();
|
this.fetchTransactions();
|
||||||
|
if (this.transactions == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
List<ArbitraryTransactionData> transactionDataList = new ArrayList<>(this.transactions);
|
List<ArbitraryTransactionData> transactionDataList = new ArrayList<>(this.transactions);
|
||||||
|
|
||||||
@ -217,6 +223,11 @@ public class ArbitraryDataResource {
|
|||||||
private void calculateChunkCounts() {
|
private void calculateChunkCounts() {
|
||||||
try {
|
try {
|
||||||
this.fetchTransactions();
|
this.fetchTransactions();
|
||||||
|
if (this.transactions == null) {
|
||||||
|
this.localChunkCount = 0;
|
||||||
|
this.totalChunkCount = 0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
List<ArbitraryTransactionData> transactionDataList = new ArrayList<>(this.transactions);
|
List<ArbitraryTransactionData> transactionDataList = new ArrayList<>(this.transactions);
|
||||||
int localChunkCount = 0;
|
int localChunkCount = 0;
|
||||||
@ -236,6 +247,9 @@ public class ArbitraryDataResource {
|
|||||||
private boolean isRateLimited() {
|
private boolean isRateLimited() {
|
||||||
try {
|
try {
|
||||||
this.fetchTransactions();
|
this.fetchTransactions();
|
||||||
|
if (this.transactions == null) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
List<ArbitraryTransactionData> transactionDataList = new ArrayList<>(this.transactions);
|
List<ArbitraryTransactionData> transactionDataList = new ArrayList<>(this.transactions);
|
||||||
|
|
||||||
@ -259,6 +273,10 @@ public class ArbitraryDataResource {
|
|||||||
private boolean isDataPotentiallyAvailable() {
|
private boolean isDataPotentiallyAvailable() {
|
||||||
try {
|
try {
|
||||||
this.fetchTransactions();
|
this.fetchTransactions();
|
||||||
|
if (this.transactions == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
Long now = NTP.getTime();
|
Long now = NTP.getTime();
|
||||||
if (now == null) {
|
if (now == null) {
|
||||||
return false;
|
return false;
|
||||||
@ -290,6 +308,10 @@ public class ArbitraryDataResource {
|
|||||||
private boolean isDownloading() {
|
private boolean isDownloading() {
|
||||||
try {
|
try {
|
||||||
this.fetchTransactions();
|
this.fetchTransactions();
|
||||||
|
if (this.transactions == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
Long now = NTP.getTime();
|
Long now = NTP.getTime();
|
||||||
if (now == null) {
|
if (now == null) {
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user