Added check to ensure variable is assigned before being used.
Added `self.window.folders()` fallback to _determine_path