avoid crashing when translation is null
Handle onMessages when db is null.