mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
time: do not panic for time.parse("2020-02-02 20.02.20")!, just return an error instead (fix #16779)
This commit is contained in:
@@ -70,6 +70,9 @@ pub fn parse(s string) !Time {
|
||||
}
|
||||
shms := s[pos..]
|
||||
hms := shms.split(':')
|
||||
if hms.len != 3 {
|
||||
return error_invalid_time(9)
|
||||
}
|
||||
hour_ := hms[0][1..]
|
||||
minute_ := hms[1]
|
||||
second_ := hms[2]
|
||||
|
||||
Reference in New Issue
Block a user