Skip to content

Commit d7b9a77

Browse files
committed
Fix: Use form if available
1 parent 420c059 commit d7b9a77

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/pages/editor/editor.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -921,7 +921,8 @@ class EditorState extends State<Editor> {
921921
final newName = filenameTextEditingController.text;
922922
if (newName == coreInfo.fileName) return;
923923

924-
if (_validateFilenameTextField(newName) == null) {
924+
if (_filenameFormKey.currentState?.validate() ??
925+
_validateFilenameTextField(newName) == null) {
925926
coreInfo.filePath = await FileManager.moveFile(
926927
coreInfo.filePath + Editor.extension, newName + Editor.extension);
927928
coreInfo.filePath = coreInfo.filePath

0 commit comments

Comments
 (0)