$self->{resp_code} = $resp_code;
$self->{resp_msg} = $resp_msg;
- return undef unless ($resp_code == 0);
+ return undef unless (defined($resp_code) && $resp_code == 0);
my $cur_metric;
my @lines = split (/^/, $in);
return undef unless $line;
my ($version, $resp_code, $resp_msg) = $self->_parse_response_line($line);
- return 0 unless ($resp_msg eq 'PONG');
+ return 0 unless (defined($resp_msg) && $resp_msg eq 'PONG');
return 1;
}
/* Insert new list in place of include element */
last = g_list_last (cb->rec->addrs);
- elt->prev->next = cb->rec->addrs;
- elt->next->prev = last;
+ if (elt->prev) {
+ elt->prev->next = cb->rec->addrs;
+ }
+ if (elt->next) {
+ elt->next->prev = last;
+ }
cb->rec->addrs->prev = elt->prev;
last->next = elt->next;