sdcp: Improved checking for devices that do not have sdcp-data

This commit is contained in:
Joshua Grisham 2025-09-09 21:33:19 +02:00
parent 26d947b404
commit 9931b11a5d
2 changed files with 9 additions and 4 deletions

View file

@ -1031,7 +1031,10 @@ reset_sdcp_if_device_untrusted (FpDevice *dev,
if (g_error_matches (error, FP_DEVICE_ERROR, FP_DEVICE_ERROR_UNTRUSTED))
{
g_debug ("resetting SDCP connection");
g_object_set (G_OBJECT (dev), "sdcp-data", NULL);
if (g_object_class_find_property(G_OBJECT_GET_CLASS (dev), "sdcp-data"))
g_object_set (G_OBJECT (dev), "sdcp-data", NULL, NULL);
store.sdcp_data_delete (dev);
}
}

View file

@ -442,9 +442,11 @@ file_storage_sdcp_data_save (FpDevice *dev)
dirpath = get_sdcp_data_path (dev);
path = g_build_filename (dirpath, get_boot_id (), NULL);
/* Skip if sdcp-data is already saved for this boot_id. */
if (g_file_test (path, G_FILE_TEST_EXISTS))
return 0;
if (g_object_class_find_property (G_OBJECT_GET_CLASS (dev), "sdcp-data") == NULL)
{
g_debug ("file_storage_sdcp_data_save(): device does not have 'scdp-data'");
return -ENOENT;
}
g_object_get (G_OBJECT (dev), "sdcp-data", &sdcp_data, NULL);