diff --git a/src/space.c b/src/space.c
index 2b974a8234c62a58b62fc3481b8b28e9b8399d55..60ee47d5b989dc91b762bc438579e3a0c5eacb83 100644
--- a/src/space.c
+++ b/src/space.c
@@ -4263,6 +4263,13 @@ void space_first_init_bparts_mapper(void *restrict map_data, int count,
 #endif
   }
 
+  /* Check that the smoothing lengths are non-zero */
+  for (int k = 0; k < count; k++) {
+    if (bp[k].h <= 0.)
+      error("Invalid value of smoothing length for bpart %lld h=%e", bp[k].id,
+            bp[k].h);
+  }
+
   /* Initialise the rest */
   for (int k = 0; k < count; k++) {