diff --git a/UserInterface/Views/BrokerSettings.axaml.cs b/UserInterface/Views/BrokerSettings.axaml.cs index 1d80121..0862a86 100644 --- a/UserInterface/Views/BrokerSettings.axaml.cs +++ b/UserInterface/Views/BrokerSettings.axaml.cs @@ -45,7 +45,7 @@ namespace UserInterface.Views public void Configure(object sender, RoutedEventArgs args) { var model = (BrokerSettingsViewModel)this.DataContext; - var result = this.client.InvokeAsync(x => x.WriteMqttBrokerSettingsAsync(new MqttSettings() { Host = model.Host, Username = model.Username, Password = model.Password })); + var result = this.client.InvokeAsync(x => x.WriteMqttBrokerSettingsAsync(new MqttSettings() { Host = model.Host, Username = model.Username, Password = model.Password ?? "" })); } public async void GetSettings() diff --git a/hass-workstation-service/Data/ConfigurationService.cs b/hass-workstation-service/Data/ConfigurationService.cs index b352d6a..daee9a9 100644 --- a/hass-workstation-service/Data/ConfigurationService.cs +++ b/hass-workstation-service/Data/ConfigurationService.cs @@ -226,7 +226,7 @@ namespace hass_workstation_service.Data { Host = settings.Host, Username = settings.Username, - Password = settings.Password + Password = settings.Password ?? "" }; await JsonSerializer.SerializeAsync(stream, configuredBroker);