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

DEF-3280 Fixed some null pointer accesses due to "malformed" manifest files #91

Merged
merged 1 commit into from
Aug 22, 2018

Conversation

mathiaswking
Copy link
Contributor

No description provided.

private Map<String, Object> getManifestContext(ManifestConfiguration manifestConfig) throws ExtenderException {
ManifestPlatformConfig manifestPlatformConfig = manifestConfig.platforms.get(this.platform);
public static Map<String, Object> getManifestContext(String platform, Configuration config, ManifestConfiguration manifestConfig) throws ExtenderException {
ManifestPlatformConfig manifestPlatformConfig = manifestConfig.platforms.get(platform);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Made the function static for easier unit testing

@@ -670,7 +670,7 @@ private File buildJavaExtension(File manifest, Map<String, Object> manifestConte
throw new ExtenderException(String.format("Extension %s contains invalid platform(s): %s. Allowed platforms: %s", manifestConfig.name, manifestPlatforms.toString(), allowedPlatforms.toString()));
}

if (manifestPlatformConfig != null) {
if (manifestPlatformConfig != null && manifestPlatformConfig.context != null) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

An empty "context:" is the same as omitting it, so an empty HashMap() is now returned.

@mathiaswking mathiaswking merged commit 0dae4ac into master Aug 22, 2018
@mathiaswking mathiaswking deleted the def3280 branch August 22, 2018 08:27
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

Successfully merging this pull request may close these issues.

1 participant