mirror of
https://github.com/foomo/simplecert.git
synced 2026-07-01 15:20:02 +00:00
prevent a nil pointer exception if the status API is called but the config hasn't been initialized yet
This commit is contained in:
@@ -24,6 +24,12 @@ func Status() *CertStatus {
|
||||
var certData []byte
|
||||
if !local {
|
||||
|
||||
// prevent a nil pointer exception if the status API is called
|
||||
// but the config hasn't been initialized yet
|
||||
if c == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
// read cert resource from disk
|
||||
b, err := ioutil.ReadFile(filepath.Join(c.CacheDir, certResourceFileName))
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user