xkbcomp: Don't explode on invalid virtual modifiers testcase: 'virtualModifiers=LevelThreC' Signed-off-by: Daniel Stone <daniels@collabora.com>
diff --git a/src/xkbcomp/expr.c b/src/xkbcomp/expr.c
index 5d43cba..91713da 100644
--- a/src/xkbcomp/expr.c
+++ b/src/xkbcomp/expr.c
@@ -101,6 +101,8 @@ LookupModMask(struct xkb_context *ctx, const void *priv, xkb_atom_t field,
return false;
str = xkb_atom_text(ctx, field);
+ if (!str)
+ return false;
if (istreq(str, "all")) {
*val_rtrn = MOD_REAL_MASK_ALL;