File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -378,6 +378,10 @@ func (rt *Router) ApiHandler(w http.ResponseWriter, r *http.Request) {
378378 }
379379 if ! matched {
380380 match := re .FindStringSubmatch (n .Snapshot )
381+ if len (match ) < 3 {
382+ log .Println ("Skip snapshot with unexpected name:" , n .Snapshot )
383+ continue
384+ }
381385 n .CreateDate = match [2 ]
382386 d , err := time .Parse ("2006.01.02" , n .CreateDate )
383387 n .CreateEpoch = d .Unix ()
@@ -392,6 +396,10 @@ func (rt *Router) ApiHandler(w http.ResponseWriter, r *http.Request) {
392396 } else {
393397 for _ , n := range snap_resp .Snapshots {
394398 match := re .FindStringSubmatch (n .Snapshot )
399+ if len (match ) < 3 {
400+ log .Println ("Skip snapshot with unexpected name:" , n .Snapshot )
401+ continue
402+ }
395403 n .CreateDate = match [2 ]
396404 d , err := time .Parse ("2006.01.02" , n .CreateDate )
397405 n .CreateEpoch = d .Unix ()
You can’t perform that action at this time.
0 commit comments