Null error handling on path.join