Check that error.info exists (#3865)

GitOrigin-RevId: 83c575cc3b94d9d6564d4a2919f81e7b47a116cc
This commit is contained in:
Alf Eaton 2021-03-31 11:45:01 +01:00 committed by Copybot
parent 8227e68aca
commit a2be1f8981

View file

@ -89,7 +89,7 @@ const InstitutionsAPI = {
},
function(error, body) {
if (error) {
if (error.info.statusCode === 422) {
if (error.info && error.info.statusCode === 422) {
return callback(
new InvalidInstitutionalEmailError(error.message).withCause(error)
)