mirror of
https://github.com/binwiederhier/ntfy.git
synced 2025-05-30 10:25:40 +02:00
Fix panic when using Firebase without users
This commit is contained in:
parent
ba46630138
commit
8ca08ce868
3 changed files with 34 additions and 1 deletions
server
|
@ -162,7 +162,13 @@ func New(conf *Config) (*Server, error) {
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
firebaseClient = newFirebaseClient(sender, userManager)
|
||||
// This awkward logic is required because Go is weird about nil types and interfaces.
|
||||
// See issue #641, and https://go.dev/play/p/uur1flrv1t3 for an example
|
||||
var auther user.Auther
|
||||
if userManager != nil {
|
||||
auther = userManager
|
||||
}
|
||||
firebaseClient = newFirebaseClient(sender, auther)
|
||||
}
|
||||
s := &Server{
|
||||
config: conf,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue