Skip to content

Commit ee9fc5c

Browse files
committed
fix: nil pointer when deleting MachinePool
1 parent ee37fc7 commit ee9fc5c

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
@@ -746,6 +746,9 @@ func (m *MachinePoolScope) GetBootstrapData(ctx context.Context) (string, error)
746746

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

0 commit comments

Comments
 (0)