1
0
mirror of https://github.com/Qortal/qortal.git synced 2025-03-16 04:12:31 +00:00

Fixed divide by zero error in GET /arbitrary/resource/status/*

This commit is contained in:
CalDescent 2023-04-21 18:21:41 +01:00
parent 4954a1744b
commit 3c251c35ea

@ -46,7 +46,7 @@ public class ArbitraryResourceStatus {
this.description = status.description;
this.localChunkCount = localChunkCount;
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) {