Skip to content

Commit 643e253

Browse files
committed
Fix possible null pointrt
1 parent f6a100e commit 643e253

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/environment.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,9 @@ namespace Sass {
128128
template <typename T>
129129
void Environment<T>::set_lexical(const std::string& key, T val)
130130
{
131-
auto cur = this; bool shadow = false;
132-
while (cur->is_lexical() || shadow) {
131+
auto cur = this;
132+
bool shadow = false;
133+
while ((cur && cur->is_lexical()) || shadow) {
133134
if (cur->has_local(key)) {
134135
cur->set_local(key, val);
135136
return;

0 commit comments

Comments
 (0)