mirror of
https://github.com/jagandeepbrar/lunasea.git
synced 2026-08-31 04:32:32 +00:00
fix(Settings): Safe-guard connection test headers map cast
This commit is contained in:
@@ -135,7 +135,7 @@ class _State extends State<_Widget> with LunaScrollControllerMixin {
|
||||
Radarr(
|
||||
host: _profile.radarrHost,
|
||||
apiKey: _profile.radarrKey,
|
||||
headers: Map<String, dynamic>.from(_profile.radarrHeaders),
|
||||
headers: Map<String, dynamic>.from(_profile.radarrHeaders ?? {}),
|
||||
)
|
||||
.system
|
||||
.status()
|
||||
|
||||
@@ -147,7 +147,8 @@ class _State extends State<_Widget> with LunaScrollControllerMixin {
|
||||
Sonarr(
|
||||
host: _profile.sonarrHost,
|
||||
apiKey: _profile.sonarrKey,
|
||||
headers: Map<String, dynamic>.from(_profile.sonarrHeaders))
|
||||
headers:
|
||||
Map<String, dynamic>.from(_profile.sonarrHeaders ?? {}))
|
||||
.system
|
||||
.getStatus()
|
||||
.then((_) => showLunaSuccessSnackBar(
|
||||
|
||||
@@ -113,14 +113,14 @@ class _State extends State<_Widget> with LunaScrollControllerMixin {
|
||||
icon: Icons.wifi_tethering_rounded,
|
||||
onTap: () async {
|
||||
ProfileHiveObject _profile = Database.currentProfileObject;
|
||||
if (_profile.tautulliHost == null || _profile.tautulliHost.isEmpty) {
|
||||
if (_profile?.tautulliHost?.isEmpty ?? true) {
|
||||
showLunaErrorSnackBar(
|
||||
title: 'Host Required',
|
||||
message: 'Host is required to connect to Tautulli',
|
||||
);
|
||||
return;
|
||||
}
|
||||
if (_profile.tautulliKey == null || _profile.tautulliKey.isEmpty) {
|
||||
if (_profile?.tautulliKey?.isEmpty ?? true) {
|
||||
showLunaErrorSnackBar(
|
||||
title: 'API Key Required',
|
||||
message: 'API key is required to connect to Tautulli',
|
||||
@@ -130,7 +130,8 @@ class _State extends State<_Widget> with LunaScrollControllerMixin {
|
||||
Tautulli(
|
||||
host: _profile.tautulliHost,
|
||||
apiKey: _profile.tautulliKey,
|
||||
headers: Map<String, dynamic>.from(_profile.tautulliHeaders))
|
||||
headers:
|
||||
Map<String, dynamic>.from(_profile?.tautulliHeaders ?? {}))
|
||||
.miscellaneous
|
||||
.arnold()
|
||||
.then((_) => showLunaSuccessSnackBar(
|
||||
|
||||
Reference in New Issue
Block a user