diff --git a/server/app/controller/sessionLog.js b/server/app/controller/sessionLog.js index ffb92a0..a970282 100644 --- a/server/app/controller/sessionLog.js +++ b/server/app/controller/sessionLog.js @@ -4,8 +4,8 @@ const sessionDB = new SessionDB().getInstance() async function getLog({ res }) { let sessionList = await sessionDB.findAsync({}) - let { ipWhiteList } = await keyDB.findOneAsync({}) - ipWhiteList = ipWhiteList.filter(ip => Boolean(ip)) + let { ipWhiteList = [] } = await keyDB.findOneAsync({}) || {} + ipWhiteList = ipWhiteList.filter(ip => typeof ip === 'string' && ip.trim() !== '') sessionList = sessionList.map(item => { // eslint-disable-next-line no-unused-vars const { session, ...otherInfo } = item