Skip to content

Commit

Permalink
explain when nil can be returned
Browse files Browse the repository at this point in the history
  • Loading branch information
jreidinger committed Apr 6, 2016
1 parent 941e3af commit 1aaeaf4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lib/bootloader/sections.rb
Expand Up @@ -22,6 +22,8 @@ def default

return @default = "" if Yast::Stage.initial

# Execute.on_target can return nil if call failed. It shows users error popup, but bootloader
# can continue with empty default section
saved = Yast::Execute.on_target("/usr/bin/grub2-editenv", "list", stdout: :capture) || ""
saved_line = saved.lines.grep(/saved_entry=/).first

Expand Down
1 change: 1 addition & 0 deletions test/grub2base_test.rb
Expand Up @@ -357,6 +357,7 @@
end

before do
allow(Yast::Execute).to receive(:on_target).and_return("")
subject.define_singleton_method(:name) { "grub2base" }
end

Expand Down

0 comments on commit 1aaeaf4

Please sign in to comment.