Fix crash when trying to create document with nil title