Fix issues for clang-analyzer-8
[alexxy/gromacs.git] / src / gromacs / ewald / pme_spread.cpp
index d21f4c6a240c28faa3ec8ab2dffddeb38eab0c39..8e3b31be21fb6cdbe3fe1ec4d8d8f7adf1d752b4 100644 (file)
@@ -50,6 +50,7 @@
 #include "gromacs/utility/basedefinitions.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/smalloc.h"
 
 #include "pme_grid.h"
@@ -874,6 +875,7 @@ void spread_on_grid(const gmx_pme_t *pme,
 
     nthread = pme->nthread;
     assert(nthread > 0);
+    GMX_ASSERT(grids != nullptr || !bSpread, "If there's no grid, we cannot be spreading");
 
 #ifdef PME_TIME_THREADS
     c1 = omp_cyc_start();