Skip to content

Commit 4012cd0

Browse files
authored
Add nil check for regex pattern in pattern AST
1 parent c1dee89 commit 4012cd0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/elixir/lib/regex.ex

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,6 +1008,9 @@ defmodule Regex do
10081008

10091009
pattern_ast =
10101010
cond do
1011+
is_nil(regex.re_pattern) ->
1012+
nil
1013+
10111014
# TODO: Remove this when we require Erlang/OTP 28+
10121015
# Before OTP 28.0, patterns did not contain any refs and could be safely be escaped
10131016
:erlang.system_info(:otp_release) < [?2, ?8] ->

0 commit comments

Comments
 (0)