Skip to content

Commit

Permalink
ubuntu: Don't crash if not inited
Browse files Browse the repository at this point in the history
  • Loading branch information
rojer committed May 17, 2022
1 parent 4a003fe commit 770a0fe
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/avahi/mgos_dns_sd_avahi.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ bool mgos_dns_sd_add_service_instance(

bool mgos_dns_sd_remove_service_instance(const char *name, const char *proto,
int port) {
if (s_client == NULL) return false;
struct mgos_dns_sd_service_entry *e;
SLIST_FOREACH(e, &s_names, next) {
if (e->port == port && strcasecmp(e->name, name) == 0 &&
Expand All @@ -211,6 +212,7 @@ bool mgos_dns_sd_remove_service_instance(const char *name, const char *proto,
}

const char *mgos_dns_sd_get_host_name(void) {
if (s_client == NULL) return NULL;
return avahi_client_get_host_name_fqdn(s_client);
}

Expand Down

0 comments on commit 770a0fe

Please sign in to comment.