diff --git a/app/build.gradle b/app/build.gradle index 939c6f0c..345123ca 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -18,7 +18,7 @@ android { targetSdkVersion 22 versionCode 84 - versionName "0.9.1" + versionName "0.9.1.1" buildConfigField "java.util.Date", "buildTime", "new java.util.Date()" } diff --git a/app/src/main/java/at/bitfire/davdroid/resource/DavResourceFinder.java b/app/src/main/java/at/bitfire/davdroid/resource/DavResourceFinder.java index dfe591c6..fa370150 100644 --- a/app/src/main/java/at/bitfire/davdroid/resource/DavResourceFinder.java +++ b/app/src/main/java/at/bitfire/davdroid/resource/DavResourceFinder.java @@ -35,6 +35,7 @@ import at.bitfire.dav4android.DavResource; import at.bitfire.dav4android.UrlUtils; import at.bitfire.dav4android.exception.DavException; import at.bitfire.dav4android.exception.HttpException; +import at.bitfire.dav4android.exception.NotFoundException; import at.bitfire.dav4android.property.AddressbookDescription; import at.bitfire.dav4android.property.AddressbookHomeSet; import at.bitfire.dav4android.property.CalendarColor; @@ -413,20 +414,23 @@ public class DavResourceFinder { paths.add("/"); } - for (String path : paths) { - if (!TextUtils.isEmpty(scheme) && !TextUtils.isEmpty(fqdn) && port != null && paths != null) { - HttpUrl initialContextPath = new HttpUrl.Builder() - .scheme(scheme) - .host(fqdn).port(port) - .encodedPath(path) - .build(); + for (String path : paths) + try { + if (!TextUtils.isEmpty(scheme) && !TextUtils.isEmpty(fqdn) && port != null && paths != null) { + HttpUrl initialContextPath = new HttpUrl.Builder() + .scheme(scheme) + .host(fqdn).port(port) + .encodedPath(path) + .build(); - log.info("Trying to determine principal from initial context path=" + initialContextPath); - HttpUrl principal = getCurrentUserPrincipal(initialContextPath); - if (principal != null) - return principal; + log.info("Trying to determine principal from initial context path=" + initialContextPath); + HttpUrl principal = getCurrentUserPrincipal(initialContextPath); + if (principal != null) + return principal; + } + } catch(NotFoundException e) { + log.warn("No resource found", e); } - } return null; } diff --git a/app/src/main/java/at/bitfire/davdroid/ui/setup/LoginURLFragment.java b/app/src/main/java/at/bitfire/davdroid/ui/setup/LoginURLFragment.java index 29fa18af..348a4513 100644 --- a/app/src/main/java/at/bitfire/davdroid/ui/setup/LoginURLFragment.java +++ b/app/src/main/java/at/bitfire/davdroid/ui/setup/LoginURLFragment.java @@ -7,6 +7,7 @@ */ package at.bitfire.davdroid.ui.setup; +import android.app.Activity; import android.app.DialogFragment; import android.app.Fragment; import android.content.Context; @@ -156,7 +157,9 @@ public class LoginURLFragment extends Fragment implements TextWatcher { @Override public void onTextChanged(CharSequence s, int start, int before, int count) { - getActivity().invalidateOptionsMenu(); + Activity activity = getActivity(); + if (activity != null) + activity.invalidateOptionsMenu(); } @Override diff --git a/dav4android b/dav4android index 6a83ed5a..b77404b8 160000 --- a/dav4android +++ b/dav4android @@ -1 +1 @@ -Subproject commit 6a83ed5a370f92fb8d8440a6e4a06d9e2fa3dfcd +Subproject commit b77404b82c6bae193754344ecb00b7e4be88797f