Skip to content

Commit 4564798

Browse files
schadocalexchris-smith
authored andcommitted
Check if .match is null instead of its length (#101)
Better check to alert users if their ROS_IP is set incorrectly somewhere.
1 parent e2a2f1f commit 4564798

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/utils/network_utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ let NetworkUtils = {
6666
getAddressAndPortFromUri(uriString) {
6767
let regexStr = /(?:http:\/\/|rosrpc:\/\/)?([a-zA-Z\d\-.:]+):(\d+)/;
6868
let match = uriString.match(regexStr);
69-
if (match.length !== 3) {
69+
if (match === null) {
7070
throw new Error ('Unable to find host and port from uri ' + uriString + ' with regex ' + regexStr);
7171
}
7272
// else

0 commit comments

Comments
 (0)