瀏覽代碼

Handle null content with fewer errors

Zachary Kotlarek 12 年之前
父節點
當前提交
cbe9697c16
共有 1 個文件被更改,包括 6 次插入 和 0 次删除
  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