[fix] return error properly when attachment is missing, avoiding a crash (code is still not properly split in this branch)
[fix] return error properly when attachment is missing, avoiding a crash (code is still not properly split in this branch)