Redmine/6523: don't hit performance database unnecessarily

Coding style violation;
```
}
else
{
```