all: remove more pointless NULL checks

GObject creation cannot normally fail, except for types that implement
GInitable and take a GError in their _new() method. Some NM types
override constructor() and return NULL in some cases, but these
generally only happen in the case of programmer error (eg, failing to
set a mandatory property), and so crashing is reasonable (and most
likely inevitable anyway).

So, remove all NULL checks after calls to g_object_new() and its
myriad wrappers.

https://bugzilla.gnome.org/show_bug.cgi?id=693678
This commit is contained in:
Dan Winship
2013-01-31 15:36:12 -05:00
parent d04f286327
commit 08f04466e8
24 changed files with 68 additions and 748 deletions

View File

@@ -782,11 +782,6 @@ make_ip6_setting (NMConnection *connection,
gboolean never_default = !has_default_ip6_route (conn_name);
s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new ();
if (!s_ip6) {
g_set_error (error, ifnet_plugin_error_quark (), 0,
"Could not allocate IP6 setting");
return;
}
value = ifnet_get_data (conn_name, "enable_ipv6");
if (value && is_true (value))
@@ -1671,8 +1666,6 @@ ifnet_update_connection_from_config_block (const char *conn_name,
gboolean success = FALSE;
connection = nm_connection_new ();
if (!connection)
return NULL;
setting = nm_connection_get_setting_connection (connection);
if (!setting) {
setting = NM_SETTING_CONNECTION (nm_setting_connection_new ());