From a55306f4bee92d9be3927a0f997d510ae82d1cc1 Mon Sep 17 00:00:00 2001 From: Daku Date: Wed, 12 Aug 2015 06:58:44 +0100 Subject: [PATCH] don't throw no handler error if empty directory / directory doesn't exist --- ext/bulk_add/main.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ext/bulk_add/main.php b/ext/bulk_add/main.php index 5af9051b..c0c0a50c 100644 --- a/ext/bulk_add/main.php +++ b/ext/bulk_add/main.php @@ -24,6 +24,12 @@ class BulkAdd extends Extension { $list = add_dir($_POST['dir']); if(strlen($list) > 0) { $this->theme->add_status("Adding files", $list); + } else { + if(is_dir($_POST['dir'])) { + $this->theme->add_status("No files in directory", "No files exists in specified directory ({$_POST['dir']})."); + } else { + $this->theme->add_status("Directory does not exist", "Specified directory does not exist ({$_POST['dir']})."); + } } $this->theme->display_upload_results($page); }