1
0
mirror of https://github.com/etesync/android synced 2024-11-15 20:38:58 +00:00

Resource detection: fix NPE

This commit is contained in:
Ricki Hirner 2016-03-29 15:19:53 +02:00
parent 879b137cfc
commit c498225064
2 changed files with 3 additions and 4 deletions

View File

@ -45,7 +45,6 @@ import at.bitfire.dav4android.property.DisplayName;
import at.bitfire.dav4android.property.ResourceType;
import at.bitfire.dav4android.property.SupportedCalendarComponentSet;
import at.bitfire.davdroid.HttpClient;
import at.bitfire.davdroid.InvalidAccountException;
import at.bitfire.davdroid.log.StringHandler;
import at.bitfire.davdroid.model.CollectionInfo;
import lombok.RequiredArgsConstructor;
@ -178,7 +177,7 @@ public class DavResourceFinder {
// check for resource type "principal"
if (principal == null) {
ResourceType resourceType = (ResourceType)davBase.properties.get(ResourceType.NAME);
if (resourceType.types.contains(ResourceType.PRINCIPAL))
if (resourceType != null && resourceType.types.contains(ResourceType.PRINCIPAL))
principal = davBase.location;
}
@ -319,7 +318,7 @@ public class DavResourceFinder {
DavResource dav = new DavResource(httpClient, url, log);
dav.propfind(0, CurrentUserPrincipal.NAME);
CurrentUserPrincipal currentUserPrincipal = (CurrentUserPrincipal) dav.properties.get(CurrentUserPrincipal.NAME);
CurrentUserPrincipal currentUserPrincipal = (CurrentUserPrincipal)dav.properties.get(CurrentUserPrincipal.NAME);
if (currentUserPrincipal != null && currentUserPrincipal.href != null) {
HttpUrl principal = dav.location.resolve(currentUserPrincipal.href);
if (principal != null) {

@ -1 +1 @@
Subproject commit aa7480cf952d8b86e64637713ebf47e7cb2b4a35
Subproject commit 2d01d3b45d71e18d256fbb9d3b131b45b57c1f34