Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(networkInterface): make sure to check networkInterface is defined #185

Merged
merged 1 commit into from
Aug 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- Fix globbing issue [#126](https://github.com/logdna/logdna-agent/pull/126)
- Fix configuration-related bugs [#130](https://github.com/logdna/logdna-agent/pull/130)
- Make sure to check `networkInterface` is defined [#185](https://github.com/logdna/logdna-agent/pull/185)

## [1.6.1] - July 19, 2019
### Added
Expand Down
6 changes: 4 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,10 @@ if ((os.platform() === 'win32' && require('is-administrator')()) || process.getu
interface.address.startsWith('192.168.'));
})[0];

if (networkInterface.mac) { config.mac = networkInterface.mac; }
if (networkInterface.address) { config.ip = networkInterface.address; }
if (networkInterface) {
smusali marked this conversation as resolved.
Show resolved Hide resolved
if (networkInterface.mac) { config.mac = networkInterface.mac; }
if (networkInterface.address) { config.ip = networkInterface.address; }
}

utils.log(`${config.package} started on ${config.hostname} (${config.ip})`);
if (config.platform && config.platform.startsWith('k8s')) { k8s.init(); }
Expand Down