From fc33bcf056a9db4d7a2e8de447d3402d6f97ba69 Mon Sep 17 00:00:00 2001 From: Chuck Date: Thu, 8 Jan 2026 13:40:12 -0500 Subject: [PATCH] fix: Handle None value for feeds config to prevent TypeError Fix crash when plugin_config['feeds'] exists but is None, causing TypeError when checking 'custom_feeds' in feeds_config. Problem: - When plugin_config['feeds'] exists but is None, dict.get('feeds', {}) returns None (not the default {}) because dict.get() only uses default when key doesn't exist, not when value is None - Line 3642's 'custom_feeds' in feeds_config raises TypeError because None is not iterable - This can crash the API endpoint if a plugin config has feeds: null Solution: - Change plugin_config.get('feeds', {}) to plugin_config.get('feeds') or {} to ensure feeds_config is always a dict (never None) - Add feeds_config check before 'in' operator for extra safety This ensures the code gracefully handles feeds: null in plugin configuration. --- web_interface/blueprints/api_v3.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web_interface/blueprints/api_v3.py b/web_interface/blueprints/api_v3.py index bad7e5b1..de16d59e 100644 --- a/web_interface/blueprints/api_v3.py +++ b/web_interface/blueprints/api_v3.py @@ -3638,8 +3638,8 @@ def save_plugin_config(): # Force fix for feeds.custom_feeds if it's still a dict (fallback) if 'feeds' in plugin_config: - feeds_config = plugin_config.get('feeds', {}) - if 'custom_feeds' in feeds_config and isinstance(feeds_config['custom_feeds'], dict): + feeds_config = plugin_config.get('feeds') or {} + if feeds_config and 'custom_feeds' in feeds_config and isinstance(feeds_config['custom_feeds'], dict): custom_feeds_dict = feeds_config['custom_feeds'] # Check if all keys are numeric keys = list(custom_feeds_dict.keys())