Revert "Remove useless if-clause."
It wasn't so useless after all...

This reverts commit b0587c0a5b88acfb25cd4c1c41cae7b7aeaa0101.