diff --git a/TelegramBotBase/States/JSONStateMachine.cs b/TelegramBotBase/States/JSONStateMachine.cs index d8995be..7035692 100644 --- a/TelegramBotBase/States/JSONStateMachine.cs +++ b/TelegramBotBase/States/JSONStateMachine.cs @@ -36,7 +36,7 @@ namespace TelegramBotBase.States this.FallbackStateForm = fallbackStateForm; - if (!this.FallbackStateForm.IsSubclassOf(typeof(FormBase))) + if (this.FallbackStateForm != null && !this.FallbackStateForm.IsSubclassOf(typeof(FormBase))) { throw new ArgumentException("FallbackStateForm is not a subclass of FormBase"); } diff --git a/TelegramBotBase/States/SimpleJSONStateMachine.cs b/TelegramBotBase/States/SimpleJSONStateMachine.cs index 0b6e9e5..faba2af 100644 --- a/TelegramBotBase/States/SimpleJSONStateMachine.cs +++ b/TelegramBotBase/States/SimpleJSONStateMachine.cs @@ -36,7 +36,7 @@ namespace TelegramBotBase.States this.FallbackStateForm = fallbackStateForm; - if (!this.FallbackStateForm.IsSubclassOf(typeof(FormBase))) + if (this.FallbackStateForm != null && !this.FallbackStateForm.IsSubclassOf(typeof(FormBase))) { throw new ArgumentException("FallbackStateForm is not a subclass of FormBase"); } diff --git a/TelegramBotBase/States/XMLStateMachine.cs b/TelegramBotBase/States/XMLStateMachine.cs index 76fe5bd..2542f6a 100644 --- a/TelegramBotBase/States/XMLStateMachine.cs +++ b/TelegramBotBase/States/XMLStateMachine.cs @@ -35,7 +35,7 @@ namespace TelegramBotBase.States this.FallbackStateForm = fallbackStateForm; - if (!this.FallbackStateForm.IsSubclassOf(typeof(FormBase))) + if (this.FallbackStateForm != null && !this.FallbackStateForm.IsSubclassOf(typeof(FormBase))) { throw new ArgumentException("FallbackStateForm is not a subclass of FormBase"); }