Handling of nulls in serverReceiveMessages function