summaryrefslogtreecommitdiff
path: root/src/trg-file-parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/trg-file-parser.c')
-rw-r--r--src/trg-file-parser.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/trg-file-parser.c b/src/trg-file-parser.c
index 0a4a8c0..582ee82 100644
--- a/src/trg-file-parser.c
+++ b/src/trg-file-parser.c
@@ -113,10 +113,15 @@ trg_torrent_file *trg_parse_torrent_file(const gchar *filename)
be_node *top_node, *info_node, *name_node;
trg_torrent_file *ret = NULL;
+ if (g_file_test(filename, G_FILE_TEST_IS_REGULAR)) {
+ g_error("%s does not exist", filename);
+ return NULL;
+ }
+
mf = g_mapped_file_new(filename, FALSE, &error);
if (error) {
- g_message("%s",error->message);
+ g_error("%s",error->message);
g_error_free(error);
g_mapped_file_unref(mf);
return NULL;