Skip to content

Commit 772f9f8

Browse files
committed
fix: improve port parsing logic in InboundsService
- Updated port assignment logic to handle non-numeric values more gracefully by parsing the port from the configuration and defaulting to 0 if the parsed value is NaN.
1 parent 8d35c77 commit 772f9f8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/modules/inbounds/inbounds.service.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ export class InboundsService {
5858
const ports = rawFromConfig.port.split(',');
5959
port = Number(ports[0]);
6060
} else {
61-
port = 0;
61+
const parsedPort = Number(rawFromConfig.port);
62+
port = isNaN(parsedPort) ? 0 : parsedPort;
6263
}
6364
}
6465

@@ -117,7 +118,8 @@ export class InboundsService {
117118
const ports = rawFromConfig.port.split(',');
118119
port = Number(ports[0]);
119120
} else {
120-
port = 0;
121+
const parsedPort = Number(rawFromConfig.port);
122+
port = isNaN(parsedPort) ? 0 : parsedPort;
121123
}
122124
}
123125

0 commit comments

Comments
 (0)