Skip to content
Snippets Groups Projects
Commit deb85d27 authored by Giovanni Bussi's avatar Giovanni Bussi
Browse files

cppcheck fix

found with cppcheck 2.1

cc: @gtribello

[multicolvar/InPlaneDistances.cpp:110] (warning) :nullPointerRedundantCheck: Either the condition 'bt' is redundant or there is possible null pointer dereference: bt.

This looks like it might be a real bug! Should be checked and potentially backported if it's a bug fix.
parent 47a3e603
No related branches found
No related tags found
No related merge requests found
...@@ -107,7 +107,9 @@ InPlaneDistances::InPlaneDistances(const ActionOptions&ao): ...@@ -107,7 +107,9 @@ InPlaneDistances::InPlaneDistances(const ActionOptions&ao):
use_link=true; rcut=lt->getCutoff(); use_link=true; rcut=lt->getCutoff();
} else { } else {
vesselbase::Between* bt=dynamic_cast<vesselbase::Between*>( getPntrToVessel(0) ); vesselbase::Between* bt=dynamic_cast<vesselbase::Between*>( getPntrToVessel(0) );
if( bt ) use_link=true; rcut=bt->getCutoff(); if( bt ) {
use_link=true; rcut=bt->getCutoff();
}
} }
if( use_link ) { if( use_link ) {
for(unsigned i=1; i<getNumberOfVessels(); ++i) { for(unsigned i=1; i<getNumberOfVessels(); ++i) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment