[gnome-boxes/obsessive-compulsive-disorder: 7/10] machine: Only clear the keyring for existing machines



commit c36b28d6d15a3bc72efe5659608ef30859662c1c
Author: Felipe Borges <felipeborges gnome org>
Date:   Thu Mar 26 12:21:21 2020 +0100

    machine: Only clear the keyring for existing machines
    
    If a Machine creation is interrupted, we don't have an entry in
    the keyring, so there's nothing to be done.
    
    This prevents Secret.password_clear from getting an NULL argument.

 src/machine.vala | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/src/machine.vala b/src/machine.vala
index 50c2644b..d86a06b7 100644
--- a/src/machine.vala
+++ b/src/machine.vala
@@ -752,6 +752,10 @@ private void handle_auth () {
     }
 
     private async void delete_auth_credentials () {
+        if (config.uuid == null) {
+            return;
+        }
+
         try {
             yield Secret.password_clear (secret_auth_schema, null,
                                          "gnome-boxes-machine-uuid", config.uuid);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]