mirror of
https://github.com/Qortal/qortal.git
synced 2025-05-05 01:07:51 +00:00
Fixed divide by zero error in GET /arbitrary/resource/status/*
This commit is contained in:
parent
4954a1744b
commit
3c251c35ea
@ -46,7 +46,7 @@ public class ArbitraryResourceStatus {
|
|||||||
this.description = status.description;
|
this.description = status.description;
|
||||||
this.localChunkCount = localChunkCount;
|
this.localChunkCount = localChunkCount;
|
||||||
this.totalChunkCount = totalChunkCount;
|
this.totalChunkCount = totalChunkCount;
|
||||||
this.percentLoaded = (this.localChunkCount != null && this.totalChunkCount != null) ? this.localChunkCount / (float)this.totalChunkCount * 100.0f : null;
|
this.percentLoaded = (this.localChunkCount != null && this.totalChunkCount != null && this.totalChunkCount > 0) ? this.localChunkCount / (float)this.totalChunkCount * 100.0f : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArbitraryResourceStatus(Status status) {
|
public ArbitraryResourceStatus(Status status) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user