[BUG #8433] Add additional if statement to prevent exceptions