fix a broken if statement (bug #4464)