Check content_length for null before parsing in http HEAD message response
fixes #468
This commit is contained in:
parent
542744ade2
commit
680d28360c
|
@ -89,7 +89,9 @@ public class FileProvider : Dino.FileProvider, Object {
|
|||
if (name == "Content-Length") content_length = val;
|
||||
});
|
||||
file_transfer.mime_type = content_type;
|
||||
file_transfer.size = int.parse(content_length);
|
||||
if (content_length != null) {
|
||||
file_transfer.size = int.parse(content_length);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -91,7 +91,9 @@ public class FileProvider : Dino.FileProvider, Object {
|
|||
if (name == "Content-Length") content_length = val;
|
||||
});
|
||||
file_transfer.mime_type = content_type;
|
||||
file_transfer.size = int.parse(content_length);
|
||||
if (content_length != null) {
|
||||
file_transfer.size = int.parse(content_length);
|
||||
}
|
||||
} else {
|
||||
warning("HTTP HEAD download status code " + head_message.status_code.to_string());
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue