aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBen Burdette <bburdette@gmail.com>2020-05-12 14:41:30 -0600
committerBen Burdette <bburdette@gmail.com>2020-05-12 14:41:30 -0600
commitecbb8e9c0a4374b26defde2cd10932d633affed3 (patch)
tree8d19dc4e1c19a78e184e358880948eb8be0dbc88 /src
parent960d4362ed2215f87a596e0a994e39aa28680db1 (diff)
no blank line if no LOC
Diffstat (limited to 'src')
-rw-r--r--src/error-demo/error-demo.cc1
-rw-r--r--src/libutil/error.cc2
2 files changed, 2 insertions, 1 deletions
diff --git a/src/error-demo/error-demo.cc b/src/error-demo/error-demo.cc
index 82e9f0580..0216092e3 100644
--- a/src/error-demo/error-demo.cc
+++ b/src/error-demo/error-demo.cc
@@ -1,5 +1,6 @@
#include "logging.hh"
#include "nixexpr.hh"
+#include "util.hh"
#include <iostream>
#include <optional>
diff --git a/src/libutil/error.cc b/src/libutil/error.cc
index e4f45a2d3..0765a2945 100644
--- a/src/libutil/error.cc
+++ b/src/libutil/error.cc
@@ -182,7 +182,7 @@ std::ostream& operator<<(std::ostream &out, const ErrorInfo &einfo)
}
// lines of code.
- if (einfo.nixCode.has_value()) {
+ if (einfo.nixCode.has_value() && einfo.nixCode->errLineOfCode.has_value()) {
printCodeLines(out, prefix, *einfo.nixCode);
out << prefix << std::endl;
}