Allow none paths (e.g. when users set text using setPlainText and not using file.open)