Add check for empty String for the local directory in addition to null and add logging.

This PR contains:
Add check for empty String for the local directory in addition to null.
Add logging to detect why return null.
I meant no configuration should trigger this case. If they do, it should be a serious bug, and it's okay to crash the program.