Skip to content

Commit

Permalink
make an additional check for empty content
Browse files Browse the repository at this point in the history
Signed-off-by: Pranav Gaikwad <[email protected]>
  • Loading branch information
pranavgaikwad committed Jan 9, 2024
1 parent fc1485f commit db0842b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion provider/internal/builtin/service_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ func (b *builtinServiceClient) getLocation(ctx context.Context, path, content st
if len(lines) > 0 && lines[len(lines)-1] == "" {
lines = lines[:len(lines)-1]
}
if len(lines) < 1 {
if len(lines) < 1 || strings.Join(lines, "") == "" {
return location, fmt.Errorf("unable to get code location, empty content")
}
pattern := fmt.Sprintf(".*?%s", strings.Join(lines, ".*?"))
Expand Down

0 comments on commit db0842b

Please sign in to comment.