Fixed an error where an invalid memory access occurred in error reporting.