From 966994168cce1399cd0b61d1bf1e5678e93eda30 Mon Sep 17 00:00:00 2001 From: hermesdt Date: Wed, 17 Sep 2014 10:25:34 +0200 Subject: [PATCH] only add value to hash if attr_element hash text --- lib/omniauth/strategies/wsfed/auth_callback.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/omniauth/strategies/wsfed/auth_callback.rb b/lib/omniauth/strategies/wsfed/auth_callback.rb index c8e8177..be7ddce 100644 --- a/lib/omniauth/strategies/wsfed/auth_callback.rb +++ b/lib/omniauth/strategies/wsfed/auth_callback.rb @@ -72,10 +72,11 @@ def claims value = [] attr_element.elements.each { |element| value << element.text } else - value = attr_element.elements.first.text.lstrip.rstrip + value = attr_element.elements.first.text + value = value.lstrip.rstrip if !value.nil? end - result[name] = value + result[name] = value if !value.nil? end end end @@ -104,4 +105,4 @@ def wstrust_lifetime end end -end \ No newline at end of file +end