diff --git a/src/org/fdroid/fdroid/AppDetails.java b/src/org/fdroid/fdroid/AppDetails.java index 500a4f2d4..186db342f 100644 --- a/src/org/fdroid/fdroid/AppDetails.java +++ b/src/org/fdroid/fdroid/AppDetails.java @@ -197,7 +197,6 @@ public class AppDetails extends ListActivity { setContentView(R.layout.appdetails); Intent i = getIntent(); - appid = ""; Uri data = i.getData(); if (data != null) { if (data.isHierarchical()) { @@ -328,11 +327,13 @@ public class AppDetails extends ListActivity { Log.d("FDroid", "Getting application details for " + appid); app = null; - List apps = ((FDroidApp) getApplication()).getApps(); - for (DB.App tapp : apps) { - if (tapp.id.equals(appid)) { - app = tapp; - break; + if (appid != null && appid.length() > 0) { + List apps = ((FDroidApp) getApplication()).getApps(); + for (DB.App tapp : apps) { + if (tapp.id.equals(appid)) { + app = tapp; + break; + } } } if (app == null) { diff --git a/src/org/fdroid/fdroid/FDroid.java b/src/org/fdroid/fdroid/FDroid.java index 96547ba62..b3c4ad0a3 100644 --- a/src/org/fdroid/fdroid/FDroid.java +++ b/src/org/fdroid/fdroid/FDroid.java @@ -89,14 +89,14 @@ public class FDroid extends FragmentActivity { String appid = data.getQueryParameter("fdid"); // If appid == null, we just browse all the apps. // If appid != null, we browse the app specified. - if (appid != null) { + if (appid != null && appid.length() > 0) { Intent call = new Intent(this, AppDetails.class); call.putExtra("appid", appid); startActivityForResult(call, REQUEST_APPDETAILS); } } else { String repoUri = data.getEncodedSchemeSpecificPart(); - if (repoUri != null) { + if (repoUri != null && repoUri.length() > 0) { Intent call = new Intent(this, ManageRepo.class); call.putExtra("repoUri", repoUri); startActivityForResult(call, REQUEST_MANAGEREPOS); diff --git a/src/org/fdroid/fdroid/ManageRepo.java b/src/org/fdroid/fdroid/ManageRepo.java index de2719afb..1e3882c9f 100644 --- a/src/org/fdroid/fdroid/ManageRepo.java +++ b/src/org/fdroid/fdroid/ManageRepo.java @@ -82,8 +82,7 @@ public class ManageRepo extends ListActivity { Intent i = getIntent(); if (i.hasExtra("repoUri")) { - String repoUri = i.getStringExtra("repoUri"); - addRepo(repoUri); + addRepo(i.getStringExtra("repoUri")); finish(); }