libweston: do not forget to check if test_data is NULL

Since commit "libweston: add required_capabilities test suite quirk"
a new function that depends on test_data is being called in wet_main().

We should check if test_data is NULL before calling it, otherwise
we have a segfault when running outside the test suite.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
This commit is contained in:
Leandro Ribeiro 2021-03-16 14:54:08 -03:00
parent 1c73ff8d57
commit 91f398bc30
1 changed files with 1 additions and 1 deletions

View File

@ -3382,7 +3382,7 @@ wet_main(int argc, char *argv[], const struct weston_testsuite_data *test_data)
goto out;
}
if (!check_compositor_capabilities(wet.compositor,
if (test_data && !check_compositor_capabilities(wet.compositor,
test_data->test_quirks.required_capabilities)) {
ret = WET_MAIN_RET_MISSING_CAPS;
goto out;