Skip to content

Commit 59aea3b

Browse files
authored
Merge pull request #5670 from helio/panic-mp-delete
fix: nil pointer when deleting MachinePool
2 parents d850497 + ee9fc5c commit 59aea3b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

azure/scope/machinepool.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -747,6 +747,9 @@ func (m *MachinePoolScope) GetBootstrapData(ctx context.Context) (string, error)
747747

748748
// calculateBootstrapDataHash calculates the sha256 hash of the bootstrap data.
749749
func (m *MachinePoolScope) calculateBootstrapDataHash(_ context.Context) (string, error) {
750+
if m.cache == nil {
751+
return "", fmt.Errorf("machinepool cache is nil")
752+
}
750753
bootstrapData := m.cache.BootstrapData
751754
h := sha256.New()
752755
n, err := io.WriteString(h, bootstrapData)

0 commit comments

Comments
 (0)