Commit 1f4c12b3 authored by Bastien Nocera's avatar Bastien Nocera Committed by Zeeshan Ali

Fix incorrect error checking

Instead of checking for whether the error got set, check for a
NULL retval instead. This avoids the application crashing later
on if a particular call errors out but doesn't set the error.
parent 8bdc03f7
......@@ -105,11 +105,10 @@ void on_ipclient_search_ready (GObject *source_object,
locator->priv->location = geocode_ipclient_search_finish (ipclient,
res,
error);
if (error != NULL) {
g_simple_async_result_set_from_error (simple, error);
if (locator->priv->location == NULL) {
g_simple_async_result_take_error (simple, error);
g_simple_async_result_complete_in_idle (simple);
g_object_unref (simple);
g_error_free (error);
return;
}
......
......@@ -38,7 +38,7 @@ on_bus_acquired (GDBusConnection *connection,
GError *error = NULL;
manager = gclue_service_manager_new (connection, &error);
if (error != NULL) {
if (manager == NULL) {
g_critical ("Failed to register server: %s", error->message);
g_error_free (&error);
......
......@@ -162,7 +162,7 @@ on_start_ready (GObject *source_object,
location,
error);
g_object_unref (location);
if (error != NULL)
if (service_location == NULL)
goto error_out;
if (!set_location (data->client, service_location, path, error))
......
......@@ -84,7 +84,7 @@ gclue_service_manager_handle_get_client (GClueServiceManager *manager,
++priv->num_clients);
client = gclue_service_client_new (peer, path, priv->connection, &error);
if (error != NULL) {
if (client == NULL) {
g_dbus_method_invocation_return_error (invocation,
G_DBUS_ERROR,
G_DBUS_ERROR_FAILED,
......
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