Understood, thanks for your suggestions and corrections :)
That check was in the original code and I left it only because I thought it was meant to catch some bugs, as there was a comment before that check saying "do exist posts without author!?"... but now I'm going to change it as you suggested, so it would work properly.