NXP-13071: Fix 'UnboundLocalError: local variable 'local_folder' referenced before assignment'