Skip to content

Commit 15bd8dc

Browse files
committed
simplify
Signed-off-by: alperozturk <alper_ozturk@proton.me>
1 parent 92a0377 commit 15bd8dc

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

app/src/main/java/com/owncloud/android/ui/fragment/util/SharePermissionManager.kt

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -105,15 +105,10 @@ class SharePermissionManager {
105105
}
106106

107107
fun isAllowDownloadAndSyncEnabled(share: OCShare?): Boolean {
108-
val shareAttributes = getShareAttributes(share)?.toMutableList()
109-
return shareAttributes.getDownloadAttribute()?.isEnabled == true
108+
return getShareAttributes(share).getDownloadAttribute()?.isEnabled == true
110109
}
111110

112111
private fun getShareAttributes(share: OCShare?): List<ShareAttributes>? {
113-
if (share == null || share.attributes == null) {
114-
return null
115-
}
116-
117-
return ShareAttributesJsonHandler.toList(share.attributes!!)
112+
return share?.attributes?.let { ShareAttributesJsonHandler.toList(it) }
118113
}
119114
}

0 commit comments

Comments
 (0)