mirror of
https://github.com/aler9/rtsp-simple-server
synced 2025-09-26 19:51:26 +08:00
sometimes sessions have an empty associated path, and this caused a crash.
This commit is contained in:
@@ -409,7 +409,13 @@ func (s *session) apiItem() *defs.APIRTSPSession {
|
||||
return defs.APIRTSPSessionStateIdle
|
||||
}
|
||||
}(),
|
||||
Path: s.rsession.Path()[1:],
|
||||
Path: func() string {
|
||||
pa := s.rsession.Path()
|
||||
if len(pa) >= 1 {
|
||||
return pa[1:]
|
||||
}
|
||||
return ""
|
||||
}(),
|
||||
Query: s.rsession.Query(),
|
||||
Transport: func() *string {
|
||||
transport := s.rsession.Transport()
|
||||
|
Reference in New Issue
Block a user