Fix NPE in RichTextDatabase.

The .first() API can return null.