From f4aeaf6ec927ca4c2e6064abcf77be5d2b411fbb Mon Sep 17 00:00:00 2001 From: Marc Durdin Date: Fri, 8 Apr 2022 11:09:11 +1000 Subject: [PATCH] fix(windows): don't log before checking nil when installing keyboard --- .../install/Keyman.Configuration.System.TIPMaintenance.pas | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/windows/src/desktop/kmshell/install/Keyman.Configuration.System.TIPMaintenance.pas b/windows/src/desktop/kmshell/install/Keyman.Configuration.System.TIPMaintenance.pas index b91bc535e5..2df2ba8a0d 100644 --- a/windows/src/desktop/kmshell/install/Keyman.Configuration.System.TIPMaintenance.pas +++ b/windows/src/desktop/kmshell/install/Keyman.Configuration.System.TIPMaintenance.pas @@ -187,10 +187,14 @@ begin try CanonicalTag := (kmcom as IKeymanBCP47Canonicalization).GetCanonicalTag(BCP47Tag); lang := GetKeyboardLanguage(KeyboardID, CanonicalTag); - KL.Log('BCP47Tag = %s, CanonicalTag = %s, lang.BCP47Code = %s', [BCP47Tag, CanonicalTag, lang.BCP47Code]); if lang = nil then + begin // The keyboard was not found + KL.Log('lang not found: BCP47Tag = %s, CanonicalTag = %s', [BCP47Tag, CanonicalTag]); Exit(False); + end; + + KL.Log('BCP47Tag = %s, CanonicalTag = %s, lang.BCP47Code = %s', [BCP47Tag, CanonicalTag, lang.BCP47Code]); if lang.IsInstalled then // After canonicalization, we may find the language is already installed