Fix checks failing on first tab

This commit is contained in:
bosshogg 2024-10-16 17:13:01 +02:00
parent de5fbf711d
commit 9fc6ea0434
1 changed files with 2 additions and 2 deletions

View File

@ -60,7 +60,7 @@ class CommandDispatcher:
def _count(self) -> int:
"""Convenience method to get the widget count."""
count = self._tabbed_browser.widget.count()
if count <= 0:
if count < 0:
raise cmdutils.CommandError("No WebView available yet!")
return count
@ -72,7 +72,7 @@ class CommandDispatcher:
def _current_index(self):
"""Convenience method to get the current widget index."""
current_index = self._tabbed_browser.widget.currentIndex()
if current_index <= 0:
if current_index < 0:
raise cmdutils.CommandError("No WebView available yet!")
return current_index