Git Product home page Git Product logo

Comments (5)

svenwltr avatar svenwltr commented on June 3, 2024

Do you get a nil pointer dereference? You also have to check if classifier.GrokClassifier is not nil. It could be nil, since it is a pointer. And if it is nil accessing Name will give you an error.

Does this help or is there another problem?

from aws-nuke.

tomvachon avatar tomvachon commented on June 3, 2024

The way I have it now I get

ERRO[0002] Listing with resources.ResourceLister failed. Please report this to https://github.com/rebuy-de/aws-nuke/issues/new.
!!! runtime error: invalid memory address or nil pointer dereference

Any time the Classifer object isnt the first if statement

from aws-nuke.

svenwltr avatar svenwltr commented on June 3, 2024

Try this:

if classifier.GrokClassifier != nil && classifier.GrokClassifier.Name != nil {

from aws-nuke.

tomvachon avatar tomvachon commented on June 3, 2024

OK, I dont know what I did or did not do, but I fixed it. I think I had a left over .Name when I was just checking for the object type....

from aws-nuke.

tomvachon avatar tomvachon commented on June 3, 2024
		for _, classifier := range output.Classifiers {
			if classifier.GrokClassifier != nil {
				resources = append(resources, &GlueClassifier{
					svc:  svc,
					name: classifier.GrokClassifier.Name,
				})
			} else if classifier.JsonClassifier != nil {
				resources = append(resources, &GlueClassifier{
					svc:  svc,
					name: classifier.JsonClassifier.Name,
				})
			} else if classifier.XMLClassifier != nil {
				resources = append(resources, &GlueClassifier{
					svc:  svc,
					name: classifier.XMLClassifier.Name,
				})
			}
		}

This is what I have now. I would have rather done it in a switch but this seems ok

from aws-nuke.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.