Bz/fix or silence coverity

This patch silence coverity scan results.
You might as well move this into the `else if`