diff --git a/src/core/Colvar.cpp b/src/core/Colvar.cpp
index a2b5ed623934821891991c4eb8c22e8cb90aae97..5da3778fb0369da02f3b9a33f2ddecbd96eb2e9b 100644
--- a/src/core/Colvar.cpp
+++ b/src/core/Colvar.cpp
@@ -85,7 +85,7 @@ void Colvar::apply(){
         v(2,2)+=forces[3*nat+8];
       }
     }
-    comm.Sum(&f[0][0],3*f.size());
+    if(f.size()>0) comm.Sum(&f[0][0],3*f.size());
     comm.Sum(&v[0][0],9);
   } else if( isEnergy ){
     forces.resize(1);