GNOME Bugzilla – Bug 654638
trying to set null label
Last modified: 2011-08-01 14:40:53 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.
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()
(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.)
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.
Attachment 192984 [details] pushed as e01baf2 - Fix critical when setting a NULL label