LibCpp: Don't crash on an empty '#' line

Closes #5634
This commit is contained in:
Itamar
2021-03-04 13:23:24 +02:00
committed by Andreas Kling
parent 3f0ace6670
commit 289c466fef

View File

@@ -67,6 +67,8 @@ void Preprocessor::handle_preprocessor_line(const StringView& line)
lexer.consume_specific('#');
consume_whitespace();
auto keyword = lexer.consume_until(' ');
if (keyword.is_empty() || keyword.is_null() || keyword.is_whitespace())
return;
if (keyword == "include") {
consume_whitespace();