Fix NULL after deref issue detected by static analysis tool
[platform/upstream/libxkbcommon.git] / src / xkbcomp / types.c
index 34e1028..fa12c23 100644 (file)
@@ -212,6 +212,9 @@ HandleIncludeKeyTypes(KeyTypesInfo *info, IncludeStmt *include)
 {
     KeyTypesInfo included;
 
+    if (!include)
+        return false;
+
     InitKeyTypesInfo(&included, info->ctx, &info->mods);
     included.name = include->stmt;
     include->stmt = NULL;