[MGNLSTK-1302] Requesting an image with a non-existing image variation causes a NullPointerException in STKImageGenerator Created: 05/Dec/13 Updated: 24/Mar/14 Resolved: 17/Mar/14 |
|
| Status: | Closed |
| Project: | Magnolia Standard Templating Kit (closed) |
| Component/s: | base system |
| Affects Version/s: | 2.0.15, 2.7.2 |
| Fix Version/s: | 2.0.19, 2.7.4 |
| Type: | Bug | Priority: | Neutral |
| Reporter: | Nils Breunese | Assignee: | Federico Grilli |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | quickwin, support, vpro | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||
| Template: |
|
||||
| Acceptance criteria: |
Empty
|
||||
| Date of First Response: | |||||
| Visible to: |
Mathijn Elhorst, Rico Jansen
|
||||
| Description |
|
Requesting an image with a non-existing image variation causes a NullPointerException in STKImageGenerator.generate. Lines 59 and 60 of STKImageGenerator are: final ImageOperationProvidingVariation variation = parameter.getImageVariation(); final ImageOperation<ParameterProvider<NodeData>> imageOperation = variation.getImageOperation(); For a request to an image with a non-existing image variation parameter.getImageVariation() will return null, which will be assigned to the variation variable. This causes a NullPointerException on the next line. |
| Comments |
| Comment by Christian Ringele [ 17/Mar/14 ] |
|
I would suggest to use the "original" variation. try { return imaging.resolveVariationName(cssSelector); } catch (NoSuchVariationException e) { log.warn(e.getMessage()); return DAMSupport.VARIATION_ORIGINAL; } Using: public static String VARIATION_ORIGINAL = "original"; |
| Comment by Ondrej Chytil [ 20/Mar/14 ] |
|
Header of test class contains wrong year, should be just 2014. |