diff --git a/qfieldsync/core/layer.py b/qfieldsync/core/layer.py index 0c7ee8a6..9b71f187 100644 --- a/qfieldsync/core/layer.py +++ b/qfieldsync/core/layer.py @@ -283,6 +283,7 @@ def visible_fields_names(self, items = None): if hasattr(item, 'children'): result += self.visible_fields_names(item.children()) elif isinstance(item, QgsAttributeEditorField): - result.append(fields.at(item.idx()).name()) + if item.idx() >= 0: + result.append(fields.at(item.idx()).name()) return result