diff --git a/StaticAnalyser/Commodore/Tape.cpp b/StaticAnalyser/Commodore/Tape.cpp index 65511293a..5aa93d250 100644 --- a/StaticAnalyser/Commodore/Tape.cpp +++ b/StaticAnalyser/Commodore/Tape.cpp @@ -378,16 +378,18 @@ std::list StaticAnalyser::Commodore::GetFiles(const std::shared_ptr data = parser.get_next_data(); + if(data) + { + File new_file; + new_file.name = header->name; + new_file.raw_name = header->raw_name; + new_file.starting_address = header->starting_address; + new_file.ending_address = header->ending_address; + new_file.data.swap(data->data); + new_file.type = (header->type == Header::RelocatableProgram) ? File::RelocatableProgram : File::NonRelocatableProgram; - File new_file; - new_file.name = header->name; - new_file.raw_name = header->raw_name; - new_file.starting_address = header->starting_address; - new_file.ending_address = header->ending_address; - new_file.data.swap(data->data); - new_file.type = (header->type == Header::RelocatableProgram) ? File::RelocatableProgram : File::NonRelocatableProgram; - - file_list.push_back(new_file); + file_list.push_back(new_file); + } header = parser.get_next_header(); }