Skip to content

Commit 5723f91

Browse files
author
Akshay Chawla
committed
Added a null pointer check for server block
1 parent 097206c commit 5723f91

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

internal/datasource/config/nginx_config_parser.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,10 @@ func (ncp *NginxConfigParser) isPort(value string) bool {
741741
}
742742

743743
func (ncp *NginxConfigParser) isSSLEnabled(serverBlock *crossplane.Directive) bool {
744+
if serverBlock == nil || serverBlock.Block == nil {
745+
return false
746+
}
747+
744748
for _, dir := range serverBlock.Block {
745749
if dir.Directive == "listen" {
746750
for _, arg := range dir.Args[1:] {

0 commit comments

Comments
 (0)