-
Type:
Bug
-
Status: Closed
-
Resolution: Fixed
-
Affects Version/s: 6.1.2 CE GA3
-
Component/s: Legacy Components, Legacy Components > API
-
Labels:
-
Branch Version/s:6.2.x
-
Backported to Branch:Committed
-
Git Pull Request:
In case the journal article's structure contains an 'Image' field, the following method will throw NullPointerException:
JournalArticleLocalServiceUtil#updateArticle(long userId, long groupId, String articleId, double version, Map<Locale,String> titleMap, Map<Locale,String> descriptionMap, String content, String layoutUuid, ServiceContext serviceContext)
That's, because the
JournalArticleLocalServiceImpl#updateArticle (which does not have "images" Map<String,byte[]> argument) calls the other
JournalArticleLocalServiceImpl#updateArticle method with null value as images map.
This null value is not checked in
JournalArticleLocalServiceImpl#formatImage (line 3030)
and throws a NullPointerException.
I'm affraid this issue is present in version 6.2 too (I had just a quick look and the method call is similar:
http://docs.huihoo.com/javadoc/liferay/6.2.0/javadocs-all/src-html/com/liferay/portlet/journal/service/impl/JournalArticleLocalServiceImpl.html#line.2024
).
Line 3030: byte[] bytes = images.get(elInstanceId + "_" + elName + elLanguage);
The exception:
Caused by: java.lang.NullPointerException
at com.liferay.portlet.journal.service.impl.JournalArticleLocalServiceImpl.formatImage(JournalArticleLocalServiceImpl.java:3030)
at com.liferay.portlet.journal.service.impl.JournalArticleLocalServiceImpl.format(JournalArticleLocalServiceImpl.java:2895)
at com.liferay.portlet.journal.service.impl.JournalArticleLocalServiceImpl.format(JournalArticleLocalServiceImpl.java:2947)
at com.liferay.portlet.journal.service.impl.JournalArticleLocalServiceImpl.updateArticle(JournalArticleLocalServiceImpl.java:2190)
at sun.reflect.GeneratedMethodAccessor2118.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
- relates
-
LPE-15206 JournalArticleLocalServiceUtil#updateArticle causes NullPointerException
-
- Closed
-