Skip to content
This repository was archived by the owner on Sep 16, 2021. It is now read-only.

Commit 3ec187a

Browse files
committed
Protect introspection calls against missing proxies
1 parent 42a4411 commit 3ec187a

File tree

1 file changed

+24
-14
lines changed

1 file changed

+24
-14
lines changed

libdleyna/renderer/device.c

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -976,22 +976,32 @@ void dlr_device_construct(
976976
NULL, priv_t);
977977

978978
av_proxy = context->service_proxies.av_proxy;
979-
if (dev->construct_step < 2)
980-
dleyna_gasync_task_add(queue_id,
981-
prv_introspect,
982-
G_OBJECT(av_proxy),
983-
prv_introspect_av_cb,
984-
cancellable,
985-
NULL, priv_t);
979+
if (dev->construct_step < 2) {
980+
if (av_proxy == NULL) {
981+
dev->construct_step++;
982+
} else {
983+
dleyna_gasync_task_add(queue_id,
984+
prv_introspect,
985+
G_OBJECT(av_proxy),
986+
prv_introspect_av_cb,
987+
cancellable,
988+
NULL, priv_t);
989+
}
990+
}
986991

987992
rc_proxy = context->service_proxies.rc_proxy;
988-
if (dev->construct_step < 3)
989-
dleyna_gasync_task_add(queue_id,
990-
prv_introspect,
991-
G_OBJECT(rc_proxy),
992-
prv_introspect_rc_cb,
993-
cancellable,
994-
NULL, priv_t);
993+
if (dev->construct_step < 3) {
994+
if (rc_proxy == NULL) {
995+
dev->construct_step++;
996+
} else {
997+
dleyna_gasync_task_add(queue_id,
998+
prv_introspect,
999+
G_OBJECT(rc_proxy),
1000+
prv_introspect_rc_cb,
1001+
cancellable,
1002+
NULL, priv_t);
1003+
}
1004+
}
9951005

9961006

9971007
/* The following task should always be completed */

0 commit comments

Comments
 (0)