Bulk change to const ref for mtop
[alexxy/gromacs.git] / src / gromacs / gmxana / gmx_nmr.cpp
index 7a6ac17faa8a0b1dd770332dd7215fce827b9d71..d98f5fc236b5f2f2f5c7813ff28962eaf55cbb2e 100644 (file)
@@ -686,8 +686,9 @@ int gmx_nmr(int argc, char* argv[])
                     snew(pairleg[i], 30);
                     j = fa[3 * i + 1];
                     k = fa[3 * i + 2];
-                    mtopGetAtomAndResidueName(topInfo.mtop(), j, &molb, &anm_j, &resnr_j, &resnm_j, nullptr);
-                    mtopGetAtomAndResidueName(topInfo.mtop(), k, &molb, &anm_k, &resnr_k, &resnm_k, nullptr);
+                    GMX_ASSERT(topInfo.hasTopology(), "Need to have a valid topology");
+                    mtopGetAtomAndResidueName(*topInfo.mtop(), j, &molb, &anm_j, &resnr_j, &resnm_j, nullptr);
+                    mtopGetAtomAndResidueName(*topInfo.mtop(), k, &molb, &anm_k, &resnr_k, &resnm_k, nullptr);
                     sprintf(pairleg[i],
                             "%d %s %d %s (%d)",
                             resnr_j,