Skip to content

Commit 11d9e3d

Browse files
committed
add nil check
1 parent 2d59221 commit 11d9e3d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

articles/azure-app-configuration/howto-variant-feature-flags-go.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ In this tutorial, you use a variant feature flag to manage experiences for diffe
536536
// Get the Greeting variant for the current user
537537
if variant, err := app.featureManager.GetVariant("Greeting", targetingContext); err != nil {
538538
log.Printf("Error getting Greeting variant: %v", err)
539-
} else if variant.ConfigurationValue != nil {
539+
} else if variant != nil && variant.ConfigurationValue != nil {
540540
// Extract the greeting message from the variant configuration
541541
if configValue, ok := variant.ConfigurationValue.(string); ok {
542542
greetingMessage = configValue

0 commit comments

Comments
 (0)