From e5682a9b25f9a09652335cfb9d13be325218ff03 Mon Sep 17 00:00:00 2001
From: 23rd <23rd@vivaldi.net>
Date: Mon, 30 Dec 2019 14:02:50 +0300
Subject: [PATCH] Fixed Spelling Highlighter creation on unsupported platforms.

---
 Telegram/SourceFiles/chat_helpers/message_field.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Telegram/SourceFiles/chat_helpers/message_field.cpp b/Telegram/SourceFiles/chat_helpers/message_field.cpp
index f6ae4593f..c2f3983a5 100644
--- a/Telegram/SourceFiles/chat_helpers/message_field.cpp
+++ b/Telegram/SourceFiles/chat_helpers/message_field.cpp
@@ -278,6 +278,9 @@ void InitSpellchecker(
 		not_null<Main::Session*> session,
 		not_null<Ui::InputField*> field) {
 #ifndef TDESKTOP_DISABLE_SPELLCHECK
+	if (!Platform::Spellchecker::IsAvailable()) {
+		return;
+	}
 	const auto s = Ui::CreateChild<Spellchecker::SpellingHighlighter>(
 		field.get(),
 		session->settings().spellcheckerEnabledValue());