SDL: Fixed crash if dbus can't be initialized (67100)

From 67100be3cfd4d953d6fdec1a126fc7975da9283e Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Tue, 4 Apr 2023 12:33:41 -0700
Subject: [PATCH] Fixed crash if dbus can't be initialized

(cherry picked from commit cf2c6fa58dea02edb870cff7090fd69f3dfbd081)
(cherry picked from commit 57043825ba04c1cbf729123ceed09c8e033adcbb)
---
 src/core/linux/SDL_fcitx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/core/linux/SDL_fcitx.c b/src/core/linux/SDL_fcitx.c
index d34cc23c4f2c..1475c71952c0 100644
--- a/src/core/linux/SDL_fcitx.c
+++ b/src/core/linux/SDL_fcitx.c
@@ -283,7 +283,8 @@ static SDL_bool
 FcitxCreateInputContext(SDL_DBusContext* dbus, const char *appname, char **ic_path) {
     const char *program = "program";
     SDL_bool retval = SDL_FALSE;
-    if (dbus->session_conn) {
+
+    if (dbus && dbus->session_conn) {
         DBusMessage *msg = dbus->message_new_method_call(FCITX_DBUS_SERVICE, FCITX_IM_DBUS_PATH, FCITX_IM_DBUS_INTERFACE, "CreateInputContext");
         if (msg) {
             DBusMessage *reply = NULL;