diff --git a/src/gs-lock-plug.c b/src/gs-lock-plug.c
index 67ab36a..4ba1e13 100644
--- a/src/gs-lock-plug.c
+++ b/src/gs-lock-plug.c
@@ -167,7 +167,7 @@ do_user_switch (GSLockPlug *plug)
         g_object_unref (context);
         g_object_unref (app);
 
-        if (!error) {
+        if (error) {
                 gs_debug ("Unable to start GDM greeter: %s", error->message);
                 g_error_free (error);
         }
