fp-device: Return an error if prints are invalid

We'd crash later otherwise, while it's better to return an error.
This commit is contained in:
Marco Trevisan (Treviño)
2022-07-14 21:14:29 +02:00
parent f03d9361e3
commit 7f6ab61292

View File

@@ -1400,6 +1400,14 @@ fp_device_identify (FpDevice *device,
return;
}
if (prints == NULL)
{
g_task_return_error (task,
fpi_device_error_new_msg (FP_DEVICE_ERROR_DATA_INVALID,
"Invalid gallery array"));
return;
}
priv->current_action = FPI_DEVICE_ACTION_IDENTIFY;
priv->current_task = g_steal_pointer (&task);
setup_task_cancellable (device);