networking: ipv4 configuration can be missing
This commit is contained in:
@@ -14,7 +14,9 @@ const assert = require('assert'),
|
||||
async function getIPv4(config) {
|
||||
assert.strictEqual(typeof config, 'object');
|
||||
|
||||
return config.ip;
|
||||
if ('ip' in config) return config.ip;
|
||||
|
||||
throw new BoxError(BoxError.NETWORK_ERROR, 'No IPv4 configured');
|
||||
}
|
||||
|
||||
async function getIPv6(config) {
|
||||
|
||||
Reference in New Issue
Block a user