diff --git a/cpp/devices/scsicd.cpp b/cpp/devices/scsicd.cpp index e1d356bd..a9f9717d 100644 --- a/cpp/devices/scsicd.cpp +++ b/cpp/devices/scsicd.cpp @@ -179,7 +179,11 @@ void SCSICD::ModeSelect(scsi_command cmd, cdb_t cdb, span buf, in ClearTrack(); CreateDataTrack(); FlushCache(); - ResizeCache(GetFilename(), GetRawMode()); + string filename; + if ((filename = GetFilename()) != "") { + // DiskCache fails without a file to compute the cache size + ResizeCache(filename, GetRawMode()); + } } if (const string result = scsi_command_util::ModeSelect(cmd, cdb, buf, length, sector_size);