diff options
author | fiaxh <git@lightrise.org> | 2018-11-29 16:30:20 +0100 |
---|---|---|
committer | fiaxh <git@lightrise.org> | 2018-11-29 16:30:20 +0100 |
commit | 680d28360c781ff29e810821801cfaba0493c526 (patch) | |
tree | e97b3036de420414f5cee69144b55732992bd2ff | |
parent | 542744ade258a77e6b1984c924f1398f88e5bb83 (diff) | |
download | dino-680d28360c781ff29e810821801cfaba0493c526.tar.gz dino-680d28360c781ff29e810821801cfaba0493c526.zip |
Check content_length for null before parsing in http HEAD message response
fixes #468
-rw-r--r-- | plugins/http-files/src/file_provider.vala | 4 | ||||
-rw-r--r-- | plugins/omemo/src/file_provider.vala | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/plugins/http-files/src/file_provider.vala b/plugins/http-files/src/file_provider.vala index 3fa32097..82ccc710 100644 --- a/plugins/http-files/src/file_provider.vala +++ b/plugins/http-files/src/file_provider.vala @@ -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); + } } } diff --git a/plugins/omemo/src/file_provider.vala b/plugins/omemo/src/file_provider.vala index 70e59574..0e11c8f4 100644 --- a/plugins/omemo/src/file_provider.vala +++ b/plugins/omemo/src/file_provider.vala @@ -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()); } |