Fix how we check whether any comments were found

fixes #7898