From 94440cab75020e5bf3ef9a601d2f1a61848242b5 Mon Sep 17 00:00:00 2001 From: Marc Durdin Date: Tue, 19 Feb 2019 16:15:11 +1100 Subject: [PATCH] [Developer] Fixes sillsdev/keyman-issues#5835. Crash when creating new touch layout in certain circumstances. --- .../developer/TIKE/oskbuilder/UframeTouchLayoutBuilder.pas | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/windows/src/developer/TIKE/oskbuilder/UframeTouchLayoutBuilder.pas b/windows/src/developer/TIKE/oskbuilder/UframeTouchLayoutBuilder.pas index 01a3841d2d..8d93a2564b 100644 --- a/windows/src/developer/TIKE/oskbuilder/UframeTouchLayoutBuilder.pas +++ b/windows/src/developer/TIKE/oskbuilder/UframeTouchLayoutBuilder.pas @@ -464,9 +464,15 @@ procedure TframeTouchLayoutBuilder.Save(const AFilename: string); var s: string; begin + if (FFilename = '') and (AFilename <> '') then + begin + Load(AFilename, not FileExists(AFilename), False); + end; + if not IsModified and FileExists(AFilename) then // I4047 // I4147 Exit; s := GetLayoutJS; + if s = '' then Exit; FSavedLayoutJS := s;