mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-08-07 22:18:30 -04:00
cups: fix initialization race
port 1.5
This commit is contained in:
@@ -116,11 +116,12 @@ func RouteRequest(conn *models.Conn, req models.Request) {
|
||||
}
|
||||
|
||||
if strings.HasPrefix(req.Method, "cups.") {
|
||||
if cupsManager == nil {
|
||||
mgr, err := ensureCupsManager()
|
||||
if err != nil {
|
||||
models.RespondError(conn, req.ID, "CUPS manager not initialized")
|
||||
return
|
||||
}
|
||||
cups.HandleRequest(conn, req, cupsManager)
|
||||
cups.HandleRequest(conn, req, mgr)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user