Skip to content

Commit

Permalink
return undefined if the get_line is called with undefined atom
Browse files Browse the repository at this point in the history
  • Loading branch information
manuel-rubio committed Jun 18, 2015
1 parent ebe8c6f commit 05ab5de
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/ephp_util.erl
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,10 @@ pad_to_bin(Num, Pad) when not is_binary(Num) ->
pad_to_bin(Num, Pad) ->
pad_to_bin(<<"0",Num/binary>>, Pad-1).

-spec get_line(line()) -> non_neg_integer().
-spec get_line(line() | undefined) -> non_neg_integer() | undefined.

get_line(undefined) ->
undefined;

get_line({{line, Line}, {column, _Column}}) ->
Line.

0 comments on commit 05ab5de

Please sign in to comment.