From 6ff0a472e658ab090b500899ea934c72276865f1 Mon Sep 17 00:00:00 2001
From: Blake Fitch <blake.fitch@tuebingen.mpg.de>
Date: Thu, 23 Jun 2022 11:11:02 +0200
Subject: [PATCH] return right away if irods_sesh is None

---
 pymods/irods_utils/irods_utils.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/pymods/irods_utils/irods_utils.py b/pymods/irods_utils/irods_utils.py
index e8bc55c..c12ae91 100644
--- a/pymods/irods_utils/irods_utils.py
+++ b/pymods/irods_utils/irods_utils.py
@@ -243,6 +243,10 @@ def confirmed_put( irods_sesh, file, new_obj_ipath, metadata_dict=None, datatype
                  + " datatype: " + datatype
                  + " block_size: " + str( block_size ) )
 
+    if irods_sesh == None:
+        logging.error( "irods_sesh == None" )
+        return None
+
     # We want a hash of our file. Should put this off in a separate thread?
     try:
         sha = hashlib.sha512()
-- 
GitLab