diff --git a/src/frontend/mame/clifront.cpp b/src/frontend/mame/clifront.cpp index aa5ec7606b8..7d21585e3c7 100644 --- a/src/frontend/mame/clifront.cpp +++ b/src/frontend/mame/clifront.cpp @@ -1452,7 +1452,9 @@ void cli_frontend::romident(const std::vector &args) ident.identify(filename); // return the appropriate error code - if (ident.matches() == ident.total()) + if (ident.total() == 0) + throw emu_fatalerror(EMU_ERR_MISSING_FILES, "No files found.\n"); + else if (ident.matches() == ident.total()) return; else if (ident.matches() == ident.total() - ident.nonroms()) throw emu_fatalerror(EMU_ERR_IDENT_NONROMS, "Out of %d files, %d matched, %d are not roms.\n", ident.total(), ident.matches(), ident.nonroms()); diff --git a/src/frontend/mame/media_ident.cpp b/src/frontend/mame/media_ident.cpp index 9881e992a51..44b4271a7e5 100644 --- a/src/frontend/mame/media_ident.cpp +++ b/src/frontend/mame/media_ident.cpp @@ -332,6 +332,9 @@ void media_identifier::digest_data(std::vector &info, char const *nam void media_identifier::match_hashes(std::vector &info) { + if (info.empty()) + return; + auto match_device = [&info, listnames = std::unordered_set()] (device_t &device) mutable {