getCapability marked with @NonNull and associated npe check removed.

Signed-off-by: ardevd <edvard.holst@gmail.com>
This commit is contained in:
ardevd 2019-03-27 10:29:52 +01:00
parent b96414d794
commit f1f3d74ce6
No known key found for this signature in database
GPG key ID: C30729EE3C9A3CCE
2 changed files with 4 additions and 4 deletions

View file

@ -62,6 +62,7 @@ import java.util.List;
import java.util.Locale;
import java.util.Set;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import lombok.Getter;
import lombok.Setter;
@ -2023,6 +2024,7 @@ public class FileDataStorageManager {
return c;
}
@NonNull
public OCCapability getCapability(String accountName) {
OCCapability capability;
Cursor c = getCapabilityCursorForAccount(accountName);

View file

@ -165,7 +165,7 @@ public class FileMenuFilter {
private void filter(List<Integer> toShow, List<Integer> toHide, boolean inSingleFileFragment) {
boolean synchronizing = anyFileSynchronizing();
OCCapability capability = mComponentsGetter.getStorageManager().getCapability(mAccount.name);
boolean endToEndEncryptionEnabled = capability != null && capability.getEndToEndEncryption().isTrue();
boolean endToEndEncryptionEnabled = capability.getEndToEndEncryption().isTrue();
filterDownload(toShow, toHide, synchronizing);
filterRename(toShow, toHide, synchronizing);
@ -184,9 +184,7 @@ public class FileMenuFilter {
filterUnsetEncrypted(toShow, toHide, endToEndEncryptionEnabled);
filterSetPictureAs(toShow, toHide);
filterStream(toShow, toHide);
if (endToEndEncryptionEnabled) {
filterOpenAsRichDocument(toShow, toHide, capability);
}
filterOpenAsRichDocument(toShow, toHide, capability);
}
private void filterShareFile(List<Integer> toShow, List<Integer> toHide, OCCapability capability) {