Skip to content

Commit 4ec4785

Browse files
sangeet-joy-twsangeet-joy_xero
and
sangeet-joy_xero
authored
#675 | Fix | Cannot read properties of undefined (reading 'defaultPort') when used with nock (#687)
* Added the null check for default port * reverted open id verison change * new line --------- Co-authored-by: sangeet-joy_xero <[email protected]>
1 parent dc971bc commit 4ec4785

File tree

2 files changed

+33
-33
lines changed

2 files changed

+33
-33
lines changed

package-lock.json

+32-32
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/model/ApiError.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export class ApiError {
3838
this.request = {
3939
url: {
4040
protocol: axiosError.request.protocol,
41-
port: axiosError.request.agent.defaultPort,
41+
port: axiosError.request.agent?.defaultPort || axiosError.request.socket?.localPort,
4242
host: axiosError.request.host,
4343
path: axiosError.request.path,
4444
},

0 commit comments

Comments
 (0)