Skip to content

Commit 3dbcf59

Browse files
committed
fix
Signed-off-by: alperozturk <[email protected]>
1 parent e3194d4 commit 3dbcf59

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

library/src/main/java/com/owncloud/android/lib/resources/shares/extensions/OCShareExtensions.kt

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,11 @@ fun toggleAllowDownloadAndSync(
2323
isChecked: Boolean,
2424
useV2DownloadAttributes: Boolean
2525
): String? {
26-
val jsonArray =
27-
if (attributes?.isEmpty() == true) {
28-
JSONArray()
29-
} else {
30-
JSONArray(attributes)
31-
}
26+
var jsonArray = JSONArray()
27+
if (!attributes.isNullOrEmpty()) {
28+
jsonArray = JSONArray(attributes)
29+
}
30+
3231
val downloadAttr = jsonArray.findDownloadAttribute()
3332
val enabledKey = getEnabledKey(useV2DownloadAttributes)
3433

0 commit comments

Comments
 (0)