Filter - "Unique lines" could possibly crash if history was empty or cleared on the disk

pull/2973/head
dgtlmoon 2025-02-17 22:27:55 +01:00 zatwierdzone przez GitHub
rodzic 4d5535d72c
commit b87c92b9e0
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -352,7 +352,7 @@ class model(watch_base):
# Iterate over all history texts and see if something new exists
# Always applying .strip() to start/end but optionally replace any other whitespace
def lines_contain_something_unique_compared_to_history(self, lines: list, ignore_whitespace=False):
local_lines = []
local_lines = set([])
if lines:
if ignore_whitespace:
if isinstance(lines[0], str): # Can be either str or bytes depending on what was on the disk