Avoid Double Null Check

Cleanup
For https://bugzilla.gnome.org/show_bug.cgi?id=729851
Avoid Possible null pointer dereference in memory debug mode

Fix a use before check on pointer
For https://bugzilla.gnome.org/show_bug.cgi?id=729849