From 3b1eee5a9478dca6e9795de1071308f8d704df26 Mon Sep 17 00:00:00 2001 From: NaiJi Date: Thu, 20 Jul 2023 17:14:17 -0300 Subject: [PATCH] fix(platform): Make platform storage path nullable for compability with previous behaviour --- lib/utils/platform_adapter.dart | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/utils/platform_adapter.dart b/lib/utils/platform_adapter.dart index 6a37d035..c1bdcbde 100644 --- a/lib/utils/platform_adapter.dart +++ b/lib/utils/platform_adapter.dart @@ -6,14 +6,14 @@ import 'package:flutter/foundation.dart'; /// SelfPrivacy wrapper for Platform information provider. class PlatformAdapter { /// Persistent storage directory for data files. - static String get storagePath { - String path = '.'; + static String? get storagePath { + String? path; if (Platform.isLinux) { // https://wiki.archlinux.org/title/XDG_Base_Directory - path = Platform.environment['XDG_DATA_HOME'] ?? '.'; - if (path == '.') { + path = Platform.environment['XDG_DATA_HOME']; + if (path == null) { final String home = Platform.environment['HOME'] ?? '.'; - path += '$home/.local/share'; + path = '$home/.local/share'; } path += '/selfprivacy'; }