When the bad ids file is empty (which could happen if the process is interrupted at an inopportune moment, then when the process next starts and attempts to read the file, there will be a crash due to accessing the length of a NoneType. safe_load returns None when the content of the file is empty.
When the bad ids file is empty (which could happen if the process is interrupted at an inopportune moment, then when the process next starts and attempts to read the file, there will be a crash due to accessing the length of a NoneType. safe_load returns None when the content of the file is empty.