Attempt to fix crashs when self-checking cppcheck introduced by previous commit