Commit af5b8a6e authored by Bastien Nocera's avatar Bastien Nocera Committed by Daniel Drake
Browse files

Don't error out when there's no fingerprints

Instead, print out some information about the device, and carry
on to the next one.
parent 6f69aef5
......@@ -47,12 +47,11 @@ static void list_fingerprints(DBusGProxy *dev, const char *username)
DBusGProxy *p;
guint i;
if (!net_reactivated_Fprint_Device_list_enrolled_fingers(dev, username, &fingers, &error))
g_error("ListEnrolledFingers failed: %s", error->message);
if (fingers == NULL || g_strv_length (fingers) == 0) {
g_print("User %s has no fingers enrolled for this device.\n", username);
return;
if (!net_reactivated_Fprint_Device_list_enrolled_fingers(dev, username, &fingers, &error)) {
if (dbus_g_error_has_name (error, "net.reactivated.Fprint.Error.NoEnrolledPrints") == FALSE)
g_error("ListEnrolledFingers failed: %s", error->message);
else
fingers = NULL;
}
p = dbus_g_proxy_new_from_proxy(dev, "org.freedesktop.DBus.Properties", NULL);
......@@ -60,6 +59,11 @@ static void list_fingerprints(DBusGProxy *dev, const char *username)
dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_VALUE), &props, G_TYPE_INVALID))
g_error("GetAll on the Properties interface failed: %s", error->message);
if (fingers == NULL || g_strv_length (fingers) == 0) {
g_print("User %s has no fingers enrolled for %s.\n", username, g_value_get_string (g_hash_table_lookup (props, "name")));
return;
}
g_print("Fingerprints for user %s on %s (%s):\n",
username,
g_value_get_string (g_hash_table_lookup (props, "name")),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment