fixed an uncaught exception found by Coverity