After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 654638 - trying to set null label
trying to set null label
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: network-indicator
3.0.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2011-07-14 18:06 UTC by Dan Winship
Modified: 2011-08-01 14:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix critical when setting a NULL label (948 bytes, patch)
2011-08-01 14:16 UTC, Giovanni Campagna
committed Details | Review

Description Dan Winship 2011-07-14 18:06:42 UTC
i've started getting:

(lt-gnome-shell-real:16406): St-CRITICAL **: st_label_set_text: assertion `text != NULL' failed

at startup, which turns out to be because the network indicator is doing

            this.statusItem = new PopupMenu.PopupSwitchMenuItem(this._getDescription(), this.connected, { style_class: 'popup-subtitle-menu-item' });

and this._getDescription() is in one case returning null.

obvious fix would be to make it return '' instead, but I don't know if maybe we should be bailing out entirely in that case or what? I can get more debug info if you tell me what to get.
Comment 1 Giovanni Campagna 2011-07-15 10:29:52 UTC
That's because GObject properties are expected to accept NULL by default (and there is no way to override it in gobject-introspection). So the right fix would be to treat NULL as "" in st_label_set_text()
Comment 2 Dan Winship 2011-07-15 12:52:03 UTC
(In reply to comment #1)
> That's because GObject properties are expected to accept NULL by default

[citation required]

A label always has text. It may be 0-length, but it's still there. (As opposed to, say, a button, which might have a 0-length label, or no label at all, which are distinct states.)
Comment 3 Giovanni Campagna 2011-08-01 14:16:22 UTC
Created attachment 192984 [details] [review]
Fix critical when setting a NULL label

st_label_set_text() does not accept NULL, and emits a g_critical
in that case.

Maybe st_label_set_text() should accept NULL, maybe not. Maybe we need
to flag NULL-accepting properties with (allow-none) in the typelib.
In anyway, let's fix this.
Comment 4 Giovanni Campagna 2011-08-01 14:40:47 UTC
Attachment 192984 [details] pushed as e01baf2 - Fix critical when setting a NULL label