Skip to content
  • Andrew Zaborowski's avatar
    wifi/iwd: Check g_dbus_proxy_get_cached_property return values · f2be625a
    Andrew Zaborowski authored and Thomas Haller's avatar Thomas Haller committed
    Instead of passing the return values to g_variant_get_string or
    g_variant_boolean and then checking the return value of that call,
    add wrappers that first check's whether the variant is non-NULL
    and of the right type.
    g_variant_get_string doesn't allow a NULL parameter and will also never
    return NULL according to the docs.
    
    For the State property we assume a state "unknown" and emit a warning
    if the property can't be read, "unknown" is also a string in IWD itself
    which would be returned if something went really wrong.  In any case
    this shouldn't happen.
    
    [thaller@redhat.com: fix missing initialization of nm_auto() variable
      interfaces.]
    f2be625a