forked from sim0n00ps/OF-DL
Force media to empty list when null to avoid object deref error
This commit is contained in:
parent
ea560aebba
commit
273eb9e1d2
@ -2512,7 +2512,10 @@ public class APIHelper : IAPIHelper
|
||||
WriteRawBody($"{diagContext}-purchase-{purchase.id}", JsonConvert.SerializeObject(purchase));
|
||||
if (purchase.media == null)
|
||||
{
|
||||
DiagWarning("PurchasedTab purchase has null media | ctx={Context} userId={UserId} username={Username} purchaseId={PurchaseId} responseType={ResponseType} rawPurchase={RawPurchase}", diagContext, user.Key, resolvedUsername, purchase.id, purchase.responseType, TruncateForLog(JsonConvert.SerializeObject(purchase)));
|
||||
string textPreview = TruncateForLog(purchase.text, 100);
|
||||
DiagWarning("PurchasedTab purchase media null, setting empty list | ctx={Context} userId={UserId} username={Username} purchaseId={PurchaseId} responseType={ResponseType} createdAt={CreatedAt} postedAt={PostedAt} textPreview={TextPreview}", diagContext, user.Key, resolvedUsername, purchase.id, purchase.responseType, purchase.createdAt, purchase.postedAt, textPreview);
|
||||
Log.Warning("PurchasedTab purchase media null, setting empty list | userId={UserId} username={Username} purchaseId={PurchaseId} responseType={ResponseType} createdAt={CreatedAt} postedAt={PostedAt} textPreview={TextPreview}", user.Key, resolvedUsername, purchase.id, purchase.responseType, purchase.createdAt, purchase.postedAt, textPreview);
|
||||
purchase.media = new List<Messages.Medium>();
|
||||
}
|
||||
switch (purchase.responseType)
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user