mirror of
https://github.com/Bubuni-Team/telegram-bot.git
synced 2026-07-31 00:29:24 +03:00
Possible null dereference fixes
This commit is contained in:
@@ -6,7 +6,7 @@ namespace West.TelegramBot.ChatQuotes.Model.Quote;
|
|||||||
[JsonObject(NamingStrategyType = typeof(CamelCaseNamingStrategy))]
|
[JsonObject(NamingStrategyType = typeof(CamelCaseNamingStrategy))]
|
||||||
public class Result
|
public class Result
|
||||||
{
|
{
|
||||||
public string Image { get; set; }
|
public string Image { get; set; } = "";
|
||||||
public Type Type { get; set; }
|
public Type Type { get; set; }
|
||||||
public long Width { get; set; }
|
public long Width { get; set; }
|
||||||
public long Height { get; set; }
|
public long Height { get; set; }
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ namespace UserGroupTag
|
|||||||
User user;
|
User user;
|
||||||
if (!_userCache.TryGetValue(userId, out user))
|
if (!_userCache.TryGetValue(userId, out user))
|
||||||
{
|
{
|
||||||
user = (await Bot.GetChatMemberAsync(Chat, userId)).User;
|
user = (await Bot.GetChatMemberAsync(Chat.Id, userId)).User;
|
||||||
_userCache.SetValue(userId, user, Int32.MaxValue);
|
_userCache.SetValue(userId, user, Int32.MaxValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user