Repository: AntennaPod/AntennaPod (language: java)

Issue:
Crash after setting a sync server offline
### Checklist

- [x] I have used the search function for [**OPEN**](https://github.com/AntennaPod/AntennaPod/issues) issues to see if someone else has already submitted the same bug report.
- [x] I have **also** used the search function for [**CLOSED**](https://github.com/AntennaPod/AntennaPod/issues?q=is%3Aissue+is%3Aclosed) issues to see if the problem is already solved and just waiting to be released.
- [x] I will describe the problem with as much detail as possible.
- [x] If the bug only to occurs with a certain podcast, I will include the URL of that podcast.

### App version

3.8.0f (0d3643148)

### Android version

14

### Device model

Pixel 8

### First occurred

2 days ago

### Steps to reproduce

I have tried to reproduce, one way is like the following:
1. Open the app
2. More - Settings
3. Search "sync"
4. Choose "Synchronization - You can choose ..."
5. "Choose sync ..."
6. "Gpodder.net"
7. Open "Airplane mode" (to cut off the network)
8. Enter any "Server address" (e.g., 1)
9. Enter anything too
10. Cancel
11. Go back
12. Click "Synchronization - You can choose ..." again
The app crashes

https://github.com/user-attachments/assets/6cd3cae2-83ad-44f8-81c8-593a51dcefa6

### Expected behaviour

I think there are some possible things that could be done:
1. Maybe check the connectivity of the server address?
2. Maybe the data should be completely cleaned after cancellation?

### Current behaviour

The app crashes

### Logs

The corresponding crash log to the screen record
```
2025-04-26 15:30:38.522 11833-11833 AndroidRuntime          de.danoeh.antennapod.debug           E  FATAL EXCEPTION: main
                                                                                                    Process: de.danoeh.antennapod.debug, PID: 11833
                                                                                                    java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.equals(java.lang.Object)' on a null object reference
                                                                                                    	at com.bytehamster.lib.preferencesearch.HistoryItem.equals(HistoryItem.java:24)
                                                                                                    	at java.util.ArrayList.indexOfRange(ArrayList.java:306)
                                                                                                    	at java.util.ArrayList.indexOf(ArrayList.java:293)
                                                                                                    	at java.util.ArrayList.contains(ArrayList.java:282)
                                                                                                    	at com.bytehamster.lib.preferencesearch.SearchPreferenceFragment.addHistoryEntry(SearchPreferenceFragment.java:184)
                                                                                                    	at com.bytehamster.lib.preferencesearch.SearchPreferenceFragment.onItemClicked(SearchPreferenceFragment.java:276)
                                                                                                    	at com.bytehamster.lib.preferencesearch.SearchPreferenceAdapter.lambda$onBindViewHolder$0$com-bytehamster-lib-preferencesearch-SearchPreferenceAdapter(SearchPreferenceAdapter.java:70)
                                                                                                    	at com.bytehamster.lib.preferencesearch.SearchPreferenceAdapter$$ExternalSyntheticLambda0.onClick(D8$$SyntheticClass:0)
                                                                                                    	at android.view.View.performClick(View.java:7659)
                                                                                                    	at android.view.View.performClickInternal(View.java:7636)
                                                                                                    	at android.view.View.-$$Nest$mperformClickInternal(Unknown Source:0)
                                                                                                    	at android.view.View$PerformClick.run(View.java:30156)
                                                                                                    	at android.os.Handler.handleCallback(Handler.java:958)
                                                                                                    	at android.os.Handler.dispatchMessage(Handler.java:99)
                                                                                                    	at android.os.Looper.loopOnce(Looper.java:205)
                                                                                                    	at android.os.Looper.loop(Looper.java:294)
                                                                                                    	at android.app.ActivityThread.main(ActivityThread.java:8177)
                                                                                                    	at java.lang.reflect.Method.invoke(Native Method)
                                                                                                    	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
                                                                                                    	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971)
```


Discussion / hints:

Fix patch:
diff --git a/ui/preferences/build.gradle b/ui/preferences/build.gradle
index 7704510711..d3e81b3381 100644
--- a/ui/preferences/build.gradle
+++ b/ui/preferences/build.gradle
@@ -46,5 +46,5 @@ dependencies {
     implementation "com.squareup.okhttp3:okhttp:$okhttpVersion"
     implementation "com.squareup.okhttp3:okhttp-urlconnection:$okhttpVersion"
     implementation "org.greenrobot:eventbus:$eventbusVersion"
-    implementation 'com.github.ByteHamster:SearchPreference:2.7.1'
+    implementation 'com.github.ByteHamster:SearchPreference:2.7.3'
 }


Test patch: