diff --git a/examples/main.c b/examples/main.c
index ad28d16c25024f07f1f8d3433bc35c14fa24a426..7c0f86325eba4792ac5cd3fe32fab64ee884cb73 100644
--- a/examples/main.c
+++ b/examples/main.c
@@ -294,6 +294,14 @@ int main(int argc, char *argv[]) {
     if (myrank == 0) print_help_message();
     return 1;
   }
+  if (with_stars && !with_external_gravity && !with_self_gravity) {
+    if (myrank == 0)
+      printf(
+          "Error: Cannot run with stars but without gravity, -g or -G must be "
+          "chosen.\n");
+    if (myrank == 0) print_help_message();
+    return 1;
+  }
 
   /* Genesis 1.1: And then, there was time ! */
   clocks_set_cpufreq(cpufreq);