Commit 185e0cd0 authored by Ard Schrijvers's avatar Ard Schrijvers

CMS-11003 [Backport 11.2] Fix obvious NPE possibility

(cherry picked from commit f5ae5cf2)
parent f0066d63
/*
* Copyright 2008-2016 Hippo B.V. (http://www.onehippo.com)
* Copyright 2008-2017 Hippo B.V. (http://www.onehippo.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -568,12 +568,14 @@ public class TabsPlugin extends RenderPlugin {
}
public Component getIcon(String id, IconSize size) {
if (decorator == null) {
return null;
}
Component icon = decorator.getIcon(id, size);
if (icon != null) {
return icon;
}
ResourceReference reference = decorator != null ? decorator.getIcon(size) : null;
ResourceReference reference = decorator.getIcon(size);
return reference != null ? HippoIcon.fromResource(id, reference, size) : null;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment