Skip to content

Commit

Permalink
Добавлена проверка на двойное монтирование образов флоппи-дисков
Browse files Browse the repository at this point in the history
  • Loading branch information
3cky committed Oct 29, 2020
1 parent b8887f5 commit dcba6cd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/src/main/java/su/comp/bk/ui/BkEmuActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -1061,7 +1061,12 @@ private boolean doMountFddImage(FloppyController fddController,
FloppyDriveIdentifier fddIdentifier,
File fddImageFile, boolean isWriteProtectMode) {
try {
if (fddController != null) {
if (fddImageFile != null && fddController != null) {
for (FloppyDriveIdentifier d : FloppyDriveIdentifier.values()) {
if (fddImageFile.equals(fddController.getFloppyDriveImageFile(d))) {
unmountFddImage(d);
}
}
fddController.mountDiskImage(fddImageFile, fddIdentifier, isWriteProtectMode);
Timber.d("Mounted floppy disk image %s to drive %s in %s mode",
fddImageFile, fddIdentifier, (isWriteProtectMode ? "write protect" : "normal"));
Expand Down

0 comments on commit dcba6cd

Please sign in to comment.