diff --git a/firmware/application/apps/ui_adsb_rx.cpp b/firmware/application/apps/ui_adsb_rx.cpp index c8888e58..f53df5e9 100644 --- a/firmware/application/apps/ui_adsb_rx.cpp +++ b/firmware/application/apps/ui_adsb_rx.cpp @@ -199,6 +199,10 @@ ADSBRxAircraftDetailsView::ADSBRxAircraftDetailsView( } break; + case DATABASE_RECORD_NOT_FOUND: + // Defaults should be filled by the constructor + break; + case DATABASE_NOT_FOUND: text_manufacturer.set("No icao24.db file"); break; diff --git a/firmware/application/database.cpp b/firmware/application/database.cpp index 5c192e90..f5d16419 100644 --- a/firmware/application/database.cpp +++ b/firmware/application/database.cpp @@ -56,6 +56,9 @@ int database::retrieve_aircraft_record(AircraftDBRecord* record, std::string sea } int database::retrieve_record(std::string file_path, int index_item_length, int record_length, void* record, std::string search_term) { + if (search_term.empty()) + return DATABASE_RECORD_NOT_FOUND; + auto result = db_file.open(file_path); if (!result.is_valid()) { number_of_records = (db_file.size() / (index_item_length + record_length)); // determine number of records in file