Pārlūkot izejas kodu

Fix: incorrect submission of "" authorization

For an empty space-delimited input newAuthorizationsList,
strings.Split would produce [""].
Rod Hynes 6 gadi atpakaļ
vecāks
revīzija
41f2091498
1 mainītis faili ar 7 papildinājumiem un 1 dzēšanām
  1. 7 1
      MobileLibrary/psi/psi.go

+ 7 - 1
MobileLibrary/psi/psi.go

@@ -238,9 +238,15 @@ func SetDynamicConfig(newSponsorID, newAuthorizationsList string) {
 	defer controllerMutex.Unlock()
 	defer controllerMutex.Unlock()
 
 
 	if controller != nil {
 	if controller != nil {
+
+		var authorizations []string
+		if len(newAuthorizationsList) > 0 {
+			authorizations = strings.Split(newAuthorizationsList, " ")
+		}
+
 		controller.SetDynamicConfig(
 		controller.SetDynamicConfig(
 			newSponsorID,
 			newSponsorID,
-			strings.Split(newAuthorizationsList, " "))
+			authorizations)
 	}
 	}
 }
 }