From 0ebce1649052c7d025d95c493ea2ab3cdf3ddb5e Mon Sep 17 00:00:00 2001 From: FlorianDahn Date: Sat, 2 Jul 2022 14:05:57 +0200 Subject: [PATCH] Remove unnecessary null checks --- TelegramBotBase/Base/FormBase.cs | 9 --------- 1 file changed, 9 deletions(-) diff --git a/TelegramBotBase/Base/FormBase.cs b/TelegramBotBase/Base/FormBase.cs index fb1cb69..291e733 100644 --- a/TelegramBotBase/Base/FormBase.cs +++ b/TelegramBotBase/Base/FormBase.cs @@ -55,9 +55,6 @@ namespace TelegramBotBase.Form public async Task OnInit(InitEventArgs e) { - if (this.Events[__evInit] == null) - return; - var handler = this.Events[__evInit]?.GetInvocationList().Cast>(); if (handler == null) return; @@ -87,9 +84,6 @@ namespace TelegramBotBase.Form public async Task OnOpened(EventArgs e) { - if (this.Events[__evOpened] == null) - return; - var handler = this.Events[__evOpened]?.GetInvocationList().Cast>(); if (handler == null) return; @@ -120,9 +114,6 @@ namespace TelegramBotBase.Form public async Task OnClosed(EventArgs e) { - if (this.Events[__evClosed] == null) - return; - var handler = this.Events[__evClosed]?.GetInvocationList().Cast>(); if (handler == null) return;