@@ -132,16 +132,20 @@ type internal TootmakerTrackRegistry(path: string, localizer: StringLocalizer, s
132
132
133
133
interface TrackRegistrationEvent.Listener with
134
134
member this.OnRegisterTracks () = seq {
135
- let folders = Directory.GetDirectories( path, " *" , SearchOption.TopDirectoryOnly)
136
- for folderPath in folders do
137
- let songPath = Path.Combine( folderPath, " song.tmb" )
138
- if File.Exists songPath then
139
- use stream = File.OpenText songPath
140
- use reader = new JsonTextReader( stream)
141
- let data = serializer.Deserialize< SongDataCustom> reader
142
- yield TootmakerTrack ( data, folderPath)
135
+ if Directory.Exists path then
136
+ let folders = Directory.GetDirectories( path, " *" , SearchOption.TopDirectoryOnly)
137
+ for folderPath in folders do
138
+ let songPath = Path.Combine( folderPath, " song.tmb" )
139
+ if File.Exists songPath then
140
+ use stream = File.OpenText songPath
141
+ use reader = new JsonTextReader( stream)
142
+ let data = serializer.Deserialize< SongDataCustom> reader
143
+ yield TootmakerTrack ( data, folderPath)
143
144
}
144
145
145
146
interface TrackCollectionRegistrationEvent.Listener with
146
147
member this.OnRegisterCollections () =
147
- Seq.singleton ( TootmakerCollection ( path, localizer, sprites))
148
+ if Directory.Exists path then
149
+ Seq.singleton ( TootmakerCollection ( path, localizer, sprites))
150
+ else
151
+ Seq.empty
0 commit comments