liamcripwell commited on
Commit
2283240
1 Parent(s): c37b0d6

skip field syncing if not dict (i.e is array)

Browse files
Files changed (1) hide show
  1. data.py +3 -0
data.py CHANGED
@@ -78,6 +78,9 @@ def sync_empty_fields(dict1, dict2):
78
  Returns:
79
  dict: The modified dict1 with synced empty fields.
80
  """
 
 
 
81
  # Traverse dict2 to add or remove empty fields in dict1
82
  for key, value in dict2.items():
83
  if isinstance(value, dict): # Handle nested dictionaries
 
78
  Returns:
79
  dict: The modified dict1 with synced empty fields.
80
  """
81
+ if not isinstance(dict1, dict) or not isinstance(dict2, dict):
82
+ return dict1
83
+
84
  # Traverse dict2 to add or remove empty fields in dict1
85
  for key, value in dict2.items():
86
  if isinstance(value, dict): # Handle nested dictionaries