[gnome-boxes] remove-machine: Add a missing null check



commit c3ae749dda928d8d4c94ddd4b82d9be1aa8f6cde
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Tue Aug 25 15:13:19 2015 +0100

    remove-machine: Add a missing null check
    
    Before accessing the parsed Xml.URI object, make sure it's not null.
    This code is called multiple times while user is editting the URL and if
    it gets called at a time when entered URL is not valid, we'll get a
    crash if we don't have this check.

 src/remote-machine.vala |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/remote-machine.vala b/src/remote-machine.vala
index fb7e5e7..3f7a615 100644
--- a/src/remote-machine.vala
+++ b/src/remote-machine.vala
@@ -107,7 +107,7 @@ private class Boxes.RemoteMachine: Boxes.Machine, Boxes.IPropertiesProvider {
             return;
 
         var uri = Xml.URI.parse (source.uri);
-        if (uri.server == name) // By default server is chosen as name
+        if (uri == null || uri.server == name) // By default server is chosen as name
             return;
 
         info = uri.server;


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