Skip to content

Commit 658ddfc

Browse files
author
LeMeuble
committed
Fix issue of checksum for removed file
1 parent f7d0fd5 commit 658ddfc

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

app/src/main/java/us/shandian/giga/ui/adapter/MissionAdapter.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -664,6 +664,13 @@ private boolean handlePopupItem(@NonNull ViewHolderItem h, @NonNull MenuItem opt
664664
return true;
665665
case R.id.md5:
666666
case R.id.sha1:
667+
final StoredFileHelper storage = h.item.mission.storage;
668+
if (!storage.existsAsFile()) {
669+
Toast.makeText(mContext, R.string.missing_file, Toast.LENGTH_SHORT).show();
670+
mDeleter.append(h.item.mission);
671+
applyChanges();
672+
return true;
673+
}
667674
final NotificationManager notificationManager
668675
= ContextCompat.getSystemService(mContext, NotificationManager.class);
669676
final NotificationCompat.Builder progressNotificationBuilder
@@ -678,7 +685,6 @@ private boolean handlePopupItem(@NonNull ViewHolderItem h, @NonNull MenuItem opt
678685

679686
notificationManager.notify(HASH_NOTIFICATION_ID, progressNotificationBuilder
680687
.build());
681-
final StoredFileHelper storage = h.item.mission.storage;
682688
compositeDisposable.add(
683689
Observable.fromCallable(() -> Utility.checksum(storage, id))
684690
.subscribeOn(Schedulers.computation())

0 commit comments

Comments
 (0)