diff --git a/xugrid/ugrid/ugridbase.py b/xugrid/ugrid/ugridbase.py index c72e0700..77c940f8 100644 --- a/xugrid/ugrid/ugridbase.py +++ b/xugrid/ugrid/ugridbase.py @@ -485,7 +485,8 @@ def _prepare_connectivity( def _set_fillvalue(self, connectivity: IntArray) -> IntArray: c = connectivity.copy() - c[c == FILL_VALUE] = self.fill_value + if self.fill_value != FILL_VALUE: + c[c == FILL_VALUE] = self.fill_value return c def _precheck(self, multi_index):