diff options
author | Gatis Paeglis <gatis.paeglis@digia.com> | 2014-04-03 17:03:36 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-04-08 16:26:17 +0200 |
commit | c2b2ef32ca523bc030aadc1cea524d4918b03c09 (patch) | |
tree | d33f489e4f2e2fa9db0dd40d517cc05fd56844aa /src/plugins/platforms/xcb | |
parent | 5fe98ebb376bcbc8728e4ce64b697637404a55e1 (diff) |
Don't access null pointer
Change-Id: If9ac712543f7c7fd85d877bba76e67ce89c60c61
Reviewed-by: Michael Brasser <michael.brasser@live.com>
Diffstat (limited to 'src/plugins/platforms/xcb')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbkeyboard.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/plugins/platforms/xcb/qxcbkeyboard.cpp b/src/plugins/platforms/xcb/qxcbkeyboard.cpp index d5c876624a..69601f44d4 100644 --- a/src/plugins/platforms/xcb/qxcbkeyboard.cpp +++ b/src/plugins/platforms/xcb/qxcbkeyboard.cpp @@ -665,9 +665,12 @@ void QXcbKeyboard::clearXKBConfig() void QXcbKeyboard::printKeymapError(const char *error) const { - qWarning() << error << "Current XKB configuration data search paths are: "; - for (unsigned int i = 0; i < xkb_context_num_include_paths(xkb_context); ++i) - qWarning() << xkb_context_include_path_get(xkb_context, i); + qWarning() << error; + if (xkb_context) { + qWarning() << "Current XKB configuration data search paths are: "; + for (unsigned int i = 0; i < xkb_context_num_include_paths(xkb_context); ++i) + qWarning() << xkb_context_include_path_get(xkb_context, i); + } qWarning() << "Use QT_XKB_CONFIG_ROOT environmental variable to provide an additional search path, " "add ':' as separator to provide several search paths and/or make sure that XKB configuration data " "directory contains recent enough contents, to update please see http://cgit.freedesktop.org/xkeyboard-config/ ."; |