diff --git a/package.json b/package.json index 549192e..a764ee6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "shadowsocks-manager-wireguard", - "version": "0.31.0", + "version": "0.31.3", "description": "", "main": "index.js", "author": "Gu Yuteng ", diff --git a/wireguard.js b/wireguard.js index 254b6ec..ba69216 100644 --- a/wireguard.js +++ b/wireguard.js @@ -248,6 +248,9 @@ const getClientIp = async port => { } const result = await runCommand(`wg show ${ interface } dump | grep ${ account }`); const client = result.split(/\s/)[2]; + if(client.trim() === '(none)') { + return Promise.resolve([]); + } return Promise.resolve([ client.split(':')[0] ]); };