File tree Expand file tree Collapse file tree 1 file changed +19
-6
lines changed
Expand file tree Collapse file tree 1 file changed +19
-6
lines changed Original file line number Diff line number Diff line change 11using System ;
22using System . Collections . Generic ;
3- using System . ComponentModel . DataAnnotations ;
43using System . IO ;
54using System . Threading . Tasks ;
65
@@ -25,7 +24,6 @@ public List<Models.ScanDir> ScanDirs
2524 get ;
2625 }
2726
28- [ Required ( ErrorMessage = "Scan directory is required!!!" ) ]
2927 public Models . ScanDir Selected
3028 {
3129 get => _selected ;
@@ -53,11 +51,26 @@ public ScanRepositories()
5351
5452 public override async Task < bool > Sure ( )
5553 {
56- var selectedDir = _useCustomDir ? _customDir : _selected ? . Path ;
57- if ( string . IsNullOrEmpty ( selectedDir ) )
54+ string selectedDir ;
55+ if ( _useCustomDir )
5856 {
59- App . RaiseException ( null , "Missing root directory to scan!" ) ;
60- return false ;
57+ if ( string . IsNullOrEmpty ( _customDir ) )
58+ {
59+ App . RaiseException ( null , "Missing root directory to scan!" ) ;
60+ return false ;
61+ }
62+
63+ selectedDir = _customDir ;
64+ }
65+ else
66+ {
67+ if ( _selected == null || string . IsNullOrEmpty ( _selected . Path ) )
68+ {
69+ App . RaiseException ( null , "Missing root directory to scan!" ) ;
70+ return false ;
71+ }
72+
73+ selectedDir = _selected . Path ;
6174 }
6275
6376 if ( ! Directory . Exists ( selectedDir ) )
You can’t perform that action at this time.
0 commit comments