Commit b228787f authored by Grzegorz Bizon's avatar Grzegorz Bizon

Do not raise when getting value of invalid CI node

parent 61f7bede
...@@ -55,7 +55,7 @@ module Gitlab ...@@ -55,7 +55,7 @@ module Gitlab
end end
define_method("#{symbol}_value") do define_method("#{symbol}_value") do
raise Entry::InvalidError unless valid? return unless valid?
@entries[symbol].value if @entries[symbol] @entries[symbol].value if @entries[symbol]
end end
......
...@@ -209,10 +209,8 @@ describe Gitlab::Ci::Config::Node::Global do ...@@ -209,10 +209,8 @@ describe Gitlab::Ci::Config::Node::Global do
end end
describe '#before_script' do describe '#before_script' do
it 'raises error' do it 'returns nil' do
expect { global.before_script }.to raise_error( expect(global.before_script).to be_nil
Gitlab::Ci::Config::Node::Entry::InvalidError
)
end end
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment