Browse Source

Moved the device pointer check to before any dereference is attempted.

Executive 10 years ago
parent
commit
944668823b
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/openhmd.c

+ 2 - 2
src/openhmd.c

@@ -88,11 +88,11 @@ ohmd_device* OHMD_APIENTRY ohmd_list_open_device(ohmd_context* ctx, int index)
 		ohmd_driver* driver = (ohmd_driver*)desc->driver_ptr;
 		ohmd_device* device = driver->open_device(driver, desc);
 
-		device->rotation_correction.w = 1;
-
 		if (device == NULL)
 			return NULL;
 
+		device->rotation_correction.w = 1;
+
 		device->ctx = ctx;
 		device->active_device_idx = ctx->num_active_devices;
 		ctx->active_devices[ctx->num_active_devices++] = device;