mirror of
https://github.com/f-droid/fdroidclient.git
synced 2026-01-29 17:21:26 -05:00
if it is not possible to make the sharing Uri, return a placeholder
The receiver of this can at least make some sense of it, versus null or a blank string. This prevents crashes where FDroid.repo.address is not yet set since the wifi was never enabled or it does not have an IP address yet.
This commit is contained in:
@@ -193,6 +193,8 @@ public final class Utils {
|
||||
}
|
||||
|
||||
public static Uri getSharingUri(Context context, Repo repo) {
|
||||
if (TextUtils.isEmpty(repo.address))
|
||||
return Uri.parse("http://wifi-not-enabled");
|
||||
Uri uri = Uri.parse(repo.address.replaceFirst("http", "fdroidrepo"));
|
||||
Uri.Builder b = uri.buildUpon();
|
||||
b.appendQueryParameter("fingerprint", repo.fingerprint);
|
||||
|
||||
Reference in New Issue
Block a user