Skip to content

Commit f5ce221

Browse files
committed
src: fix accessing empty string
1 parent 579fc67 commit f5ce221

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/node_dotenv.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ void Dotenv::ParseContent(const std::string_view input) {
156156
key = trim_spaces(key);
157157

158158
// If the value is not present (e.g. KEY=) set is to an empty string
159-
if (content.front() == '\n') {
159+
if (content.empty() || content.front() == '\n') {
160160
store_.insert_or_assign(std::string(key), "");
161161
continue;
162162
}

0 commit comments

Comments
 (0)