From 31312747e9052b0d856db37b53cc37e7aa2806a3 Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Wed, 3 Apr 2019 19:04:33 -0500 Subject: [PATCH] Fix from_yaml in ConfigPreferences --- src/invidious/helpers/helpers.cr | 8 ++++---- src/invidious/users.cr | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/invidious/helpers/helpers.cr b/src/invidious/helpers/helpers.cr index 792fec11..1fe41f80 100644 --- a/src/invidious/helpers/helpers.cr +++ b/src/invidious/helpers/helpers.cr @@ -17,12 +17,12 @@ struct ConfigPreferences end result = [] of String - node.nodes.each do - unless node.is_a?(YAML::Nodes::Scalar) - node.raise "Expected scalar, not #{node.class}" + node.nodes.each do |item| + unless item.is_a?(YAML::Nodes::Scalar) + node.raise "Expected scalar, not #{item.class}" end - result << node.value + result << item.value end rescue ex if node.is_a?(YAML::Nodes::Scalar) diff --git a/src/invidious/users.cr b/src/invidious/users.cr index 80fc496c..40f24870 100644 --- a/src/invidious/users.cr +++ b/src/invidious/users.cr @@ -64,12 +64,12 @@ struct Preferences end result = [] of String - node.nodes.each do - unless node.is_a?(YAML::Nodes::Scalar) - node.raise "Expected scalar, not #{node.class}" + node.nodes.each do |item| + unless item.is_a?(YAML::Nodes::Scalar) + node.raise "Expected scalar, not #{item.class}" end - result << node.value + result << item.value end rescue ex if node.is_a?(YAML::Nodes::Scalar)