From 3fa20d8fcecf4f9734c208d99193b5577fcdcb5b Mon Sep 17 00:00:00 2001 From: awsr <43862868+awsr@users.noreply.github.com> Date: Wed, 17 Dec 2025 16:44:35 -0800 Subject: [PATCH] Add type assertion --- modules/ui_extra_networks.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/ui_extra_networks.py b/modules/ui_extra_networks.py index 9321a8c4d..7d2eccae2 100644 --- a/modules/ui_extra_networks.py +++ b/modules/ui_extra_networks.py @@ -8,6 +8,7 @@ import html import base64 import urllib.parse import threading +from typing import TYPE_CHECKING from types import SimpleNamespace from pathlib import Path from html.parser import HTMLParser @@ -860,6 +861,8 @@ def create_ui(container, button_parent, tabname, skip_indexing = False): is_valid = (item is not None) and hasattr(item, 'name') and hasattr(item, 'filename') if is_valid: + if TYPE_CHECKING: + assert item is not None # Part of the definition of "is_valid" stat_size, stat_mtime = modelstats.stat(item.filename) if hasattr(item, 'size') and item.size > 0: stat_size = item.size