1
0
mirror of https://github.com/owncloud/android-library.git synced 2025-06-07 16:06:08 +00:00

Fix NullPointerException in update of public shares while keeping compatibility of the operation with servers not supporting 'name' property in shares

This commit is contained in:
David A. Velasco 2017-05-10 15:34:22 +02:00
parent a034338290
commit c9a06fc5e4

View File

@ -168,7 +168,7 @@ public class UpdateRemoteShareOperation extends RemoteOperation {
/// prepare array of parameters to update
List<Pair<String, String>> parametersToUpdate = new ArrayList<>();
if (mName.length() > 0) {
if (mName != null) {
parametersToUpdate.add(new Pair<>(PARAM_NAME, mName));
}
@ -236,7 +236,11 @@ public class UpdateRemoteShareOperation extends RemoteOperation {
} else {
result = new RemoteOperationResult(false, put);
}
if (!result.isSuccess()) {
if (!result.isSuccess() &&
!PARAM_NAME.equals(parameter.first)
// fail in "name" parameter will be ignored; requires OCX, will fail
// fails in previous versions
) {
break;
}
}