minor coverity defect: added protection for self-assignment