mirror of
https://github.com/TakeV-Lambda/dino.git
synced 2024-10-31 21:20:23 +00:00
Check content_length for null before parsing in http HEAD message response
fixes #468
This commit is contained in:
parent
542744ade2
commit
680d28360c
2 changed files with 6 additions and 2 deletions
|
@ -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