Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: nullreference error #12

Merged
merged 2 commits into from
May 4, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions appSyncClient.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ func (client *appSyncClient) CreateOrUpdateResolvers(apiID string, resolversFile
functionStatistics.Updated++
}
} else {
function, err := client.createFunction(&appsync.CreateFunctionInput{
functionResponse, err := client.createFunction(&appsync.CreateFunctionInput{
ApiId: aws.String(apiID),
DataSourceName: aws.String(function.DataSourceName),
RequestMappingTemplate: aws.String(function.RequestMappingTemplate),
Expand All @@ -159,10 +159,10 @@ func (client *appSyncClient) CreateOrUpdateResolvers(apiID string, resolversFile
})

if err != nil {
logger.Println(fmt.Sprintf("Function %s failed to create: %s", *function.Name, err))
logger.Println(fmt.Sprintf("Function %s failed to create: %s", function.Name, err))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

functionName is Already an existing variable that contains the function name.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the end I removed the functionName variable. There are plenty of references to the function variable... so felt better to just do that instead of creating separate functionName variable

functionStatistics.FailedToCreate++
} else {
functions = append(functions, function)
functions = append(functions, functionResponse)
mhd999 marked this conversation as resolved.
Show resolved Hide resolved
functionStatistics.Created++
}
}
Expand Down