Don't access a NULL path

This can happen if the Uemis is not correctly connected, but the user
still has the path set (as default DC most likely) and tries to start a
download.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2013-11-09 15:56:53 +09:00
parent e4ea41b7bc
commit 7ba5566073

View file

@ -143,7 +143,7 @@ static int number_of_file(char *path)
struct dirent * entry;
dirp = opendir(path);
while ((entry = readdir(dirp)) != NULL) {
while (dirp && (entry = readdir(dirp)) != NULL) {
#ifndef WIN32
if (entry->d_type == DT_REG) /* If the entry is a regular file */
#endif