save guard inserted
This commit is contained in:
parent
fcacfe127a
commit
baa4d47313
1 changed files with 2 additions and 2 deletions
|
|
@ -72,7 +72,7 @@ public partial class MainWindow : Window
|
|||
|
||||
private async void Button_Click(object sender, Avalonia.Interactivity.RoutedEventArgs e)
|
||||
{
|
||||
if (settings == null)
|
||||
if (settings == null || string.IsNullOrEmpty(settings.HomeAssistantUrl) || string.IsNullOrEmpty(settings.WebhookId))
|
||||
{
|
||||
StatusText.Content = "Einstellungen fehlen!";
|
||||
StatusText.Foreground = new Avalonia.Media.SolidColorBrush(Avalonia.Media.Colors.Red);
|
||||
|
|
@ -98,7 +98,7 @@ public partial class MainWindow : Window
|
|||
|
||||
private async Task GetState()
|
||||
{
|
||||
if (settings == null)
|
||||
if (settings == null || string.IsNullOrEmpty(settings.HomeAssistantUrl) || string.IsNullOrEmpty(settings.Entity) || string.IsNullOrEmpty(settings.AccessToken))
|
||||
{
|
||||
StatusText.Content = "Einstellungen fehlen!";
|
||||
StatusText.Foreground = new Avalonia.Media.SolidColorBrush(Avalonia.Media.Colors.Red);
|
||||
|
|
|
|||
Loading…
Reference in a new issue