diff options
Diffstat (limited to 'apps/contacts/import.php')
-rw-r--r-- | apps/contacts/import.php | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/apps/contacts/import.php b/apps/contacts/import.php index ca2c1e1605d..8e0a427399b 100644 --- a/apps/contacts/import.php +++ b/apps/contacts/import.php @@ -24,6 +24,11 @@ if(isset($_POST['fstype']) && $_POST['fstype'] == 'OC_FilesystemView') { } else { $file = OC_Filesystem::file_get_contents($_POST['path'] . '/' . $_POST['file']); } +if(!$file) { + OC_JSON::error(array('message' => 'Import file was empty.')); + exit(); +} +error_log('File: '.$file); if(isset($_POST['method']) && $_POST['method'] == 'new'){ $id = OC_Contacts_Addressbook::add(OC_User::getUser(), $_POST['addressbookname']); OC_Contacts_Addressbook::setActive($id, 1); |