Skip to content

Commit 7704677

Browse files
committed
Fixed trailing slash in URL causing an error
1 parent be9800c commit 7704677

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ function processParameter(param) {
8383
if (debug) console.log(`[steamid-resolver] Parameter is an url. Splitting...`)
8484
var split = param.split("/")
8585

86+
if (debug) console.log(`[steamid-resolver] Checking & removing trailing slash...`)
87+
if (split[split.length - 1] == "") split.pop() //remove trailing slash (which is now a space because of split("/"))
88+
8689
if (debug) console.log(`[steamid-resolver] Split url and returning this: ${split[split.length - 1]}`)
8790
return split[split.length - 1]
8891

0 commit comments

Comments
 (0)