From 2ffa77d92338334f11d0d8148d3d429c07249248 Mon Sep 17 00:00:00 2001 From: Lubosz Sarnecki Date: Thu, 7 Nov 2019 13:59:40 +0100 Subject: [PATCH] d/vive: Handle error when config could not be read. --- src/xrt/drivers/vive/vive_device.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/xrt/drivers/vive/vive_device.c b/src/xrt/drivers/vive/vive_device.c index e56742c13..f57c27188 100644 --- a/src/xrt/drivers/vive/vive_device.c +++ b/src/xrt/drivers/vive/vive_device.c @@ -914,11 +914,14 @@ vive_device_create(struct os_hid_device *mainboard_dev, vive_mainboard_get_device_info(d); } vive_sensors_read_firmware(d); + vive_sensors_get_imu_range_report(d); char *config = vive_sensors_read_config(d); - vive_parse_config(d, config); - free(config); + if (config != NULL) { + vive_parse_config(d, config); + free(config); + } // TODO: Replace hard coded values from OpenHMD with config double w_meters = 0.122822 / 2.0;