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

Commit 66e755a

Browse files
committed
Protect introspection calls against missing proxies
1 parent 7959306 commit 66e755a

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
@@ -977,22 +977,32 @@ void dlr_device_construct(
977977
NULL, priv_t);
978978

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

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

9971007

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

0 commit comments

Comments
 (0)