logger.warn() may use a NoneType object (pyc)

Just a small fix to avoid logger.warn() using a NoneType object.