Skip to content

Commit

Permalink
Avoid "No widget" errro messages
Browse files Browse the repository at this point in the history
  • Loading branch information
imobachgs committed Mar 29, 2021
1 parent 1e140a6 commit df75c1a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/lib/y2firewall/widgets/services_table.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,20 @@ def items
def services=(services)
old_services = @services
@services = services
change_items(items)
change_items(items) if widget_exists?

return if Yast::UI.TextMode

new_services = services - old_services
self.value = new_services
end

# Determines whether the widget exists in the UI
#
# @return [Boolean]
def widget_exists?
Yast::UI.WidgetExists(Id(widget_id))
end
end
end
end

0 comments on commit df75c1a

Please sign in to comment.