fix(config): Handle null alterId in VMess proxy config (#842)

* fix(config): Gracefully handle null alterId in proxy configurations

* Fix wrong AI based changes

---------

Co-authored-by: Kittros <yuan364299311@gmail.com>
This commit is contained in:
Alireza Ahmadi
2025-09-27 22:06:17 +02:00
committed by GitHub
parent 15d171f94e
commit c5ccfb6ead
2 changed files with 8 additions and 4 deletions
+3 -3
View File
@@ -115,9 +115,9 @@ func vmess(data string, i int) (*map[string]interface{}, string, error) {
if i > 0 {
tag = fmt.Sprintf("%d.%s", i, tag)
}
alter_id, ok := dataJson["aid"].(int)
if !ok {
alter_id = 0
alter_id := 0
if aid, ok := dataJson["aid"].(float64); ok {
alter_id = int(aid)
}
vmess := map[string]interface{}{
"type": "vmess",