File tree 1 file changed +9
-9
lines changed
1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -59,16 +59,16 @@ func ParseURI(s string) (fyne.URI, error) {
59
59
// we should punt this to whoever generated the URI in the
60
60
// first place?
61
61
62
- if len (s ) > 5 {
63
- path := s [5 :] // everything after file:
64
- if len (path ) > 2 && path [:2 ] == "//" {
65
- path = path [2 :]
66
- }
67
-
68
- // Windows files can break authority checks, so just return the parsed file URI
69
- return NewFileURI (path ), nil
62
+ if len (s ) < 6 {
63
+ return nil , errors .New ("not a valid URI" )
70
64
}
71
- return nil , errors .New ("not a valid URI" )
65
+ path := s [5 :] // everything after file:
66
+ if len (path ) > 2 && path [:2 ] == "//" {
67
+ path = path [2 :]
68
+ }
69
+
70
+ // Windows files can break authority checks, so just return the parsed file URI
71
+ return NewFileURI (path ), nil
72
72
}
73
73
74
74
repo , err := ForScheme (scheme )
You can’t perform that action at this time.
0 commit comments