iface-modem-sar: fix initialization sequence completion

We cannot just return without completing the GTask. If we see the
support check method failed, just keep on with the state machine so
that the GTask is completed in the FAIL_IF_UNSUPPORTED step.

Also, don't assume GError is set if FALSE is returned. This is the
only kind of async method where we allow this right now.
This commit is contained in:
Aleksander Morgado
2021-10-13 12:45:00 +02:00
parent 05ddf7c293
commit 58e617e03c

View File

@@ -344,10 +344,11 @@ check_support_ready (MMIfaceModemSar *self,
GError *error = NULL;
if (!MM_IFACE_MODEM_SAR_GET_INTERFACE (self)->check_support_finish (self, res, &error)) {
/* This error shouldn't be treated as critical */
mm_obj_dbg (self, "SAR support check failed: %s", error->message);
g_error_free (error);
return;
if (error) {
/* This error shouldn't be treated as critical */
mm_obj_dbg (self, "SAR support check failed: %s", error->message);
g_error_free (error);
}
} else {
/* SAR is supported! */
g_object_set_qdata (G_OBJECT (self),