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
end
define_method("#{symbol}_value") do
raise Entry::InvalidError unless valid?
return unless valid?
@entries[symbol].value if @entries[symbol]
end
......
......@@ -209,10 +209,8 @@ describe Gitlab::Ci::Config::Node::Global do
end
describe '#before_script' do
it 'raises error' do
expect { global.before_script }.to raise_error(
Gitlab::Ci::Config::Node::Entry::InvalidError
)
it 'returns nil' do
expect(global.before_script).to be_nil
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