xkbcomp: Don't dereference NULL VarDefsPtr
diff --git a/src/xkbcomp/xkbcomp.c b/src/xkbcomp/xkbcomp.c
index 4adb4be..3cfde6a 100644
--- a/src/xkbcomp/xkbcomp.c
+++ b/src/xkbcomp/xkbcomp.c
@@ -117,7 +117,7 @@ XkbcCompileKeymapFromRules(const char *rules, XkbRF_VarDefsPtr defs)
XkbComponentNamesPtr names;
XkbcDescPtr xkb;
- if (ISEMPTY(rules) || ISEMPTY(defs->layout)) {
+ if (ISEMPTY(rules) || !defs || ISEMPTY(defs->layout)) {
ERROR("rules and layout required to generate XKB keymap\n");
return NULL;
}