Fix error logger to only log if error is non-null

This commit is contained in:
Calvin Montgomery 2017-04-30 16:49:23 -07:00
parent a0af0ccab5
commit e92afcb203
1 changed files with 3 additions and 1 deletions

View File

@ -52,7 +52,9 @@ function getTorIPs(cb) {
fs.writeFile(destination,
ips.join("\n"),
error => {
LOGGER.error("Failed to write to %s: %s", destination, error);
if (error) {
LOGGER.error("Failed to write to %s: %s", destination, error);
}
});
return;
}