mirror of
https://github.com/logos-storage/logos-storage-nim-cs-dist-tests.git
synced 2026-04-19 01:03:13 +00:00
Fixes nullref in marketplace config extension
This commit is contained in:
parent
b7781a6eae
commit
aa4576c97d
@ -96,8 +96,23 @@ namespace CodexContractsPlugin.Marketplace
|
||||
|
||||
public partial class MarketplaceConfig : IMarketplaceConfigInput
|
||||
{
|
||||
public int MaxNumberOfSlashes => this.Collateral.MaxNumberOfSlashes;
|
||||
public TimeSpan PeriodDuration => TimeSpan.FromSeconds(this.Proofs.Period);
|
||||
public int MaxNumberOfSlashes
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Collateral == null) return -1;
|
||||
return Collateral.MaxNumberOfSlashes;
|
||||
}
|
||||
}
|
||||
|
||||
public TimeSpan PeriodDuration
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Proofs == null) return TimeSpan.MinValue;
|
||||
return TimeSpan.FromSeconds(this.Proofs.Period);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user