Skip to content

Commit

Permalink
[Fix] Resolve Protocol.UndefinedError by using fallback (#287)
Browse files Browse the repository at this point in the history
  • Loading branch information
OldhamMade authored Apr 24, 2024
1 parent bc245e0 commit 2a6908f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/crawly/worker.ex
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ defmodule Crawly.Worker do
parsed_item: Crawly.ParsedItem.t(),
result: {:ok, :done}
defp process_parsed_item({parsed_item, response, spider_name}) do
requests = Map.get(parsed_item, :requests, [])
items = Map.get(parsed_item, :items, [])
requests = Map.get(parsed_item, :requests) || []
items = Map.get(parsed_item, :items) || []
# Process all requests one by one
Enum.each(
requests,
Expand Down

0 comments on commit 2a6908f

Please sign in to comment.