-
Notifications
You must be signed in to change notification settings - Fork 31
Description
u.searchParams & h.searchParams may be null and causes a TypeError -- and noisy error in Sentry
File: commerce-sdk-isomorphic/lib/index.esm.js
Source functions: loginGuestUser: function (e, t) {return vI.apply(this, arguments);}, loginRegisteredUserB2C: function (e, t, r) {return mI.apply(this, arguments);},
Line with error: if (((d = e.sent), (c = (null === (i = d.headers) || void 0 === i ? void 0 : i.get("location")) || d.url), (u = new URL(c)), (l = Object.fromEntries(u.searchParams.entries())), !(d.status >= 400 || l.error))) {
Line with error: if (((u = e.sent), (l = (null === (i = u.headers) || void 0 === i ? void 0 : i.get("location")) || u.url), (h = new URL(l)), (f = Object.fromEntries(h.searchParams.entries())), !(u.status >= 400 || f.error))) {
Suggested change: u.searchParams.entries to u.searchParams?.entries ?? {} and same for h.searchParams