Skip to content

Commit 31a3159

Browse files
BrayanDSOmikehardy
authored andcommitted
fix(sync): default empty endpoint to null
(cherry picked from commit 02deb0a)
1 parent c068412 commit 31a3159

File tree

1 file changed

+4
-1
lines changed
  • AnkiDroid/src/main/java/com/ichi2/anki

1 file changed

+4
-1
lines changed

AnkiDroid/src/main/java/com/ichi2/anki/Sync.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,10 @@ fun DeckPicker.syncAuth(): SyncAuth? {
9999

100100
fun getEndpoint(context: Context): String? {
101101
val preferences = context.sharedPrefs()
102-
val currentEndpoint = preferences.getString(SyncPreferences.CURRENT_SYNC_URI, null)
102+
val currentEndpoint =
103+
preferences.getString(SyncPreferences.CURRENT_SYNC_URI, null)?.ifEmpty {
104+
null
105+
}
103106
val customEndpoint =
104107
if (preferences.getBoolean(SyncPreferences.CUSTOM_SYNC_ENABLED, false)) {
105108
preferences.getString(SyncPreferences.CUSTOM_SYNC_URI, null)

0 commit comments

Comments
 (0)