mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-10 17:28:27 -04:00
Fixed nullref in xploop
This commit is contained in:
@@ -71,8 +71,11 @@ public sealed class GamblingTxTracker : ITxTracker, INService, IReadyExecutor
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Task TrackAdd(long amount, TxData txData)
|
public Task TrackAdd(long amount, TxData? txData)
|
||||||
{
|
{
|
||||||
|
if (txData is null)
|
||||||
|
return Task.CompletedTask;
|
||||||
|
|
||||||
if (_gamblingTypes.Contains(txData.Type))
|
if (_gamblingTypes.Contains(txData.Type))
|
||||||
{
|
{
|
||||||
_stats.AddOrUpdate(txData.Type,
|
_stats.AddOrUpdate(txData.Type,
|
||||||
@@ -83,8 +86,11 @@ public sealed class GamblingTxTracker : ITxTracker, INService, IReadyExecutor
|
|||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Task TrackRemove(long amount, TxData txData)
|
public Task TrackRemove(long amount, TxData? txData)
|
||||||
{
|
{
|
||||||
|
if (txData is null)
|
||||||
|
return Task.CompletedTask;
|
||||||
|
|
||||||
if (_gamblingTypes.Contains(txData.Type))
|
if (_gamblingTypes.Contains(txData.Type))
|
||||||
{
|
{
|
||||||
_stats.AddOrUpdate(txData.Type,
|
_stats.AddOrUpdate(txData.Type,
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
using NadekoBot.Services.Currency;
|
using NadekoBot.Services.Currency;
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
namespace NadekoBot.Services;
|
namespace NadekoBot.Services;
|
||||||
|
|
||||||
public interface ICurrencyService
|
public interface ICurrencyService
|
||||||
@@ -10,32 +9,32 @@ public interface ICurrencyService
|
|||||||
Task AddBulkAsync(
|
Task AddBulkAsync(
|
||||||
IReadOnlyCollection<ulong> userIds,
|
IReadOnlyCollection<ulong> userIds,
|
||||||
long amount,
|
long amount,
|
||||||
TxData txData,
|
TxData? txData,
|
||||||
CurrencyType type = CurrencyType.Default);
|
CurrencyType type = CurrencyType.Default);
|
||||||
|
|
||||||
Task RemoveBulkAsync(
|
Task RemoveBulkAsync(
|
||||||
IReadOnlyCollection<ulong> userIds,
|
IReadOnlyCollection<ulong> userIds,
|
||||||
long amount,
|
long amount,
|
||||||
TxData txData,
|
TxData? txData,
|
||||||
CurrencyType type = CurrencyType.Default);
|
CurrencyType type = CurrencyType.Default);
|
||||||
|
|
||||||
Task AddAsync(
|
Task AddAsync(
|
||||||
ulong userId,
|
ulong userId,
|
||||||
long amount,
|
long amount,
|
||||||
TxData txData);
|
TxData? txData);
|
||||||
|
|
||||||
Task AddAsync(
|
Task AddAsync(
|
||||||
IUser user,
|
IUser user,
|
||||||
long amount,
|
long amount,
|
||||||
TxData txData);
|
TxData? txData);
|
||||||
|
|
||||||
Task<bool> RemoveAsync(
|
Task<bool> RemoveAsync(
|
||||||
ulong userId,
|
ulong userId,
|
||||||
long amount,
|
long amount,
|
||||||
TxData txData);
|
TxData? txData);
|
||||||
|
|
||||||
Task<bool> RemoveAsync(
|
Task<bool> RemoveAsync(
|
||||||
IUser user,
|
IUser user,
|
||||||
long amount,
|
long amount,
|
||||||
TxData txData);
|
TxData? txData);
|
||||||
}
|
}
|
@@ -4,6 +4,6 @@ namespace NadekoBot.Services;
|
|||||||
|
|
||||||
public interface ITxTracker
|
public interface ITxTracker
|
||||||
{
|
{
|
||||||
Task TrackAdd(long amount, TxData txData);
|
Task TrackAdd(long amount, TxData? txData);
|
||||||
Task TrackRemove(long amount, TxData txData);
|
Task TrackRemove(long amount, TxData? txData);
|
||||||
}
|
}
|
Reference in New Issue
Block a user