Skip to content

Commit

Permalink
update: 空字符串会panic
Browse files Browse the repository at this point in the history
  • Loading branch information
zodial committed May 25, 2023
1 parent 3969578 commit de3b977
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions code.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ func (f Factory) Z(k1 string) string {
// 3, code_temp根据M1反向映射得到number1
// 4, number1 转0进制得到id
func (f Factory) ToId(code string) int {
if code == "" {
return 0
}
k1 := strings.ToUpper(code[len(code)-1:])
m1 := f.config.mapContrary[k1]
z := f.Z(k1)
Expand Down

0 comments on commit de3b977

Please sign in to comment.