Fix in StateMachines

This commit is contained in:
FlorianDahn 2020-05-04 15:18:48 +02:00
parent 07dec0dc9d
commit dfa479d409
3 changed files with 3 additions and 3 deletions

View File

@ -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");
}

View File

@ -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");
}

View File

@ -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");
}