Well, that confirms my suspicions. The loop is being created because you're calling the "name" value from the output of the parse JSON action which is failing because there's no file attached. That's why the loop itself is failing. If the file upload question must be optional and you must use that action to send the email, you'll need two "versions" or copies of that action: one that's used if there is a file attached and another that's used if there isn't.
If you use another email action that allows for multiple attachments (like the Outlook "Send email" or "Send email from shared mailbox"), you can just add the variable to the attachments field (after switching to array entry mode) and it won't care if that array is empty.