Fixed crash on invalid content on a file with supported extension