Prevent possible crash when rendering a marker