There is a earlier g_return_val_if_fail check. Also gst_static_pad_template_get does not have such a check.