Fix error while validating scrape stage options

This commit is contained in:
Shadowfacts 2019-11-01 18:27:08 -04:00
parent 1a934430cc
commit 5d38d9567e
Signed by: shadowfacts
GPG Key ID: 94A5AB95422746E5
1 changed files with 12 additions and 6 deletions

View File

@ -39,15 +39,21 @@ defmodule Frenzy.Pipeline.ScrapeStage do
end
end
case opts["convert_to_data_uris"] do
nil ->
{:ok, %{opts | convert_to_data_uris: true}}
case opts do
{:ok, opts} ->
case opts["convert_to_data_uris"] do
nil ->
{:ok, %{opts | convert_to_data_uris: true}}
value when is_boolean(value) ->
{:ok, opts}
value when is_boolean(value) ->
{:ok, opts}
_ ->
{:error, "convert_to_data_uris must be a boolean"}
end
_ ->
{:error, "convert_to_data_uris must be a boolean"}
opts
end
end