From 71753d39bbc045d15a856c46ea9f0ec3ecec384f Mon Sep 17 00:00:00 2001
From: Matthieu Schaller <schaller@strw.leidenuniv.nl>
Date: Fri, 29 Mar 2019 15:06:46 +0100
Subject: [PATCH] Only do a sub-subset pair tasks for the stars if there are
 gas particles in the cell.

---
 src/runner_doiact_stars.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/runner_doiact_stars.h b/src/runner_doiact_stars.h
index e56d3b9460..6b8b12ad96 100644
--- a/src/runner_doiact_stars.h
+++ b/src/runner_doiact_stars.h
@@ -1444,7 +1444,7 @@ void DOSUB_SUBSET_STARS(struct runner *r, struct cell *ci, struct spart *sparts,
     }
 
     /* Otherwise, compute the pair directly. */
-    else if (cell_is_active_stars(ci, e)) {
+    else if (cell_is_active_stars(ci, e) && cj->hydro.count > 0) {
 
       /* Do any of the cells need to be drifted first? */
       if (cell_is_active_stars(ci, e)) {
-- 
GitLab