refactor: no throw literal in lolisafe.js

This commit is contained in:
Bobby Wibowo 2021-01-08 09:20:00 +07:00
parent e2143b4d80
commit 5781c45a3d
No known key found for this signature in database
GPG Key ID: 51C3A1E1E22D26CF

View File

@ -278,7 +278,8 @@ safe.use('/api', api)
// ClamAV scanner
if (config.uploads.scan && config.uploads.scan.enabled) {
if (!config.uploads.scan.clamOptions) {
throw 'Missing object config.uploads.scan.clamOptions (check config.sample.js)'
logger.error('Missing object config.uploads.scan.clamOptions (check config.sample.js)')
process.exit(1)
}
utils.clamscan.instance = await new ClamScan().init(config.uploads.scan.clamOptions)
utils.clamscan.version = await utils.clamscan.instance.get_version().then(s => s.trim())