Skip to content
  • Andrés G. Aragoneses's avatar
    Notifications: improve null check before AttachToWidget() (bgo#723889) · 1019bf49
    Andrés G. Aragoneses authored
    GtkNotificationArea class returns null always for its Widget property,
    which means that every user of INotificationAreaBox should check if
    it's null before dereferencing it, not only check if the object is
    null.
    
    This was not happening and was causing an apparently harmless warning
    to be printed in the console. The warning didn't have enough info
    about the exception so now the .Exception() method is used instead,
    which prints the whole stacktrace. (This has been changed in
    SoundMenuService as well, for consistency.)
    
    This didn't seem to happen in the stable branch because in there the
    class used as an INotificationAreaBox is X11NotificationAreaBox, which
    seems to be deprecated in master. Nonetheless, this fix should be
    backported too because X11NotificationAreaBox seemed to be only used
    in the Linux platform, so by backporting it we may be fixing the
    issue in other platforms.
    1019bf49