From 25fbd55694dbda84cda8cef12da2d5ec29a8b632 Mon Sep 17 00:00:00 2001 From: Merlijn Wajer Date: Sat, 13 Mar 2010 13:17:04 +0100 Subject: [PATCH] Don't error when file directory doesn't exist. Instead, ask for a new place to save to. --- Projects/SAMufasaGUI/testunit.pas | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Projects/SAMufasaGUI/testunit.pas b/Projects/SAMufasaGUI/testunit.pas index 8727e7a..320a29d 100644 --- a/Projects/SAMufasaGUI/testunit.pas +++ b/Projects/SAMufasaGUI/testunit.pas @@ -2251,8 +2251,14 @@ begin begin Result := (ScriptFile <> ''); if Result then - begin; - SynEdit.Lines.SaveToFile(ScriptFile); + begin + try + SynEdit.Lines.SaveToFile(ScriptFile); + except + mDebugLn('Cannot save the file. Try specifying a different location.'); + result := SaveCurrentScriptAs; + exit; + end; OnSaveScript(scriptfile); end else