slicer.dicomDatabase is 'Nonetype'

I was trying to use python script to transfer Dicom to nrrd. But the code ‘slicer.dicomDatabase.fileValue’ doesn’t work. It reports ‘Nonetype’ has no attribute fileValue.


Does anyone know what’s the problem and how to fix it?

The code snippet in the script repository works with latest version of Slicer.