Ver Fonte

Handle null content with fewer errors

Zachary Kotlarek há 12 anos atrás
pai
commit
cbe9697c16
1 ficheiros alterados com 6 adições e 0 exclusões
  1. 6 0
      Fetch.pm

+ 6 - 0
Fetch.pm

@@ -605,7 +605,13 @@ sub content() {
 		print STDERR "Fetch::content()\n";
 	}
 
+	# Extract content (if any)
 	my $data = $self->{'content'};
+	if (!$data) {
+		return undef();
+	}
+
+	# Standardize line endings
 	$data =~ s/\r\n/\n/;
 
 	# Return an array when requested