solve coverity defects
solve coverity defects introduced 5 April: redundant nullptr check after previous dereference; possible out-of-bounds array access; 'dead code': code which cannot logically be reached; uninitialised members.
solve coverity defects introduced 5 April: redundant nullptr check after previous dereference; possible out-of-bounds array access; 'dead code': code which cannot logically be reached; uninitialised members.