GNOME Bugzilla – Bug 651871
Gtk.TreeModel.get_path() return value can be null
Last modified: 2011-06-05 14:18:22 UTC
The return type of Gtk.TreeModel.get_path() should be "Gtk.TreePath?" instead of "Gtk.TreePath". In the API it's not mentioned if the return value can be null or not, but in the source code of Gtk.ListStore we can see that it can be null. And indeed, it's useful when the TreeIter is not valid.
Return values are usually nullable even if they are not marked to be so. There are many methods that need nullable return value, it's a such small change that it's not worth it unless you're using the experimental non-null option for valac.
If null is returned with > return null; There is this warning: > warning: `null' incompatible with return type `Gtk.TreePath` But with > return_val_if_fail (..., null); there is no warning. The purpose of this bug report was to avoid the warning message.
I'm sorry I didn't notice it was an abstract method.
commit c187aa853f1168559cfc8d2427aea8a72ea7d7bb Author: Luca Bruno <lucabru@src.gnome.org> Date: Sun Jun 5 16:17:02 2011 +0200 gtk+-2.0, gtk+-3.0: Mark TreeModel.get_path return value as nullable Fixes bug 651871. This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.