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

NPE calling intellij.version or intellij.type before it is set #208

Closed
baron1405 opened this issue Jun 27, 2017 · 4 comments
Closed

NPE calling intellij.version or intellij.type before it is set #208

baron1405 opened this issue Jun 27, 2017 · 4 comments
Assignees
Milestone

Comments

@baron1405
Copy link
Contributor

baron1405 commented Jun 27, 2017

The getVersion() and getType() methods in IntelliJPluginExtension throw an NPE because they attempt to call the startsWith on version before checking if it is null.

@zolotov zolotov self-assigned this Jul 3, 2017
@zolotov
Copy link
Member

zolotov commented Jul 7, 2017

Yes, but the version is set in the same time as the extension is added to the gradle model. Does this somehow affect you?

@baron1405
Copy link
Contributor Author

I suspect this is due to my extending your extension. After I apply the intellij plugin, I am extending your extension with my own:

project.intellij.extensions.create('sdk', IdeaSdkExtension, project)

where IdeaSdkExtension is my own class. This is legal in Gradle but obviously a corner case. I am unclear why your initialization is lost when I do this extending.

@zolotov
Copy link
Member

zolotov commented Jul 10, 2017

I can move the initialization directly to the fields declarations, hope this will help

@zolotov zolotov added this to the 0.2.14 milestone Jul 10, 2017
@baron1405
Copy link
Contributor Author

Works great now, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants