Commit ec6db5a2 authored by Huff, Israel's avatar Huff, Israel

added more nullptr checks

parent 1b345d20
Pipeline #100932 failed with stages
in 4 minutes and 40 seconds
......@@ -324,7 +324,11 @@ SFTPDir::~SFTPDir()
bool SFTPDir::isOpen() { return (p->dir != nullptr); }
bool SFTPDir::hasNext() { return (0 == sftp_dir_eof(p->dir)); }
bool SFTPDir::hasNext()
{
if (nullptr == p->dir) return false;
return (0 == sftp_dir_eof(p->dir));
}
// returns SFTPAttributes structure on success or nullptr on failure
// caller is responsible for deleting returned SFTPAttributes structure
......@@ -368,6 +372,7 @@ SFTPAttributes* SFTPDir::next()
bool SFTPDir::close()
{
if (nullptr == p->dir) return true;
int rc = sftp_closedir(p->dir);
if (SSH_NO_ERROR == rc)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment