Fix #815 "Edit Source: don't allow empty document"