Skip to content

Commit 39a1d5c

Browse files
authored
remove a hard error in formatter when CASE wih no ELSE (#723)
1 parent 7c648c3 commit 39a1d5c

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

ydb/library/yql/sql/v1/format/sql_format.cpp

+6-4
Original file line numberDiff line numberDiff line change
@@ -2236,10 +2236,12 @@ friend struct TStaticData;
22362236
NewLine();
22372237
}
22382238

2239-
Y_ENSURE(msg.HasBlock4());
2240-
const auto& block = msg.GetBlock4();
2241-
VisitKeyword(block.GetToken1());
2242-
Visit(block.GetRule_expr2());
2239+
if (msg.HasBlock4()) {
2240+
const auto& block = msg.GetBlock4();
2241+
VisitKeyword(block.GetToken1());
2242+
Visit(block.GetRule_expr2());
2243+
}
2244+
22432245
PopCurrentIndent();
22442246
NewLine();
22452247
Visit(msg.GetToken5());

0 commit comments

Comments
 (0)