Asset Publisher

An error occurred while processing the template.
The following has evaluated to null or missing:
==> monthInLetters[monthIndex]  [in template "20116#20160#129685" at line 20, column 57]

----
Tip: It's the final [] step that caused this error, not those before it.
----
Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??
----

----
FTL stack trace ("~" means nesting-related):
	- Failed at: #assign frenchDisplayDate = day + " "...  [in template "20116#20160#129685" at line 20, column 17]
----
1<#if entries?has_content> 
2	<#list entries as curEntry> 
3		<#assign assetRenderer = curEntry.getAssetRenderer() /> 
4          
5		<!-- Next 5 lines of code are for building the string that displays the date in French-->   
6 
7		<!-- Split function with "/" character is used on the date that is a string in the format "21/03/17". The resulting array is then stored in the variable dateArray --> 
8		<#assign dateArray = curEntry.publishDate?date?string.short?split("/")/> 
9 
10		<!-- Month index = the month -1 because arrays are 0-based while the months of the year are 1-based. --> 
11		<#assign monthIndex = dateArray[0]?number-1/> <!-- the ?number function casts the day string to a number--> 
12 
13		<!-- the day string is cast to a number using ?number, then stored in the variable day --> 
14		<#assign day = dateArray[1]?number/> 
15 
16		<!-- the following is simply an array of strings that holds all of the months of the year in French --> 
17		<#assign monthInLetters = ['janvier', 'février', 'mars', 'avril', 'mai', 'juin', 'juillet', 'août', 'septembre', 'octobre', 'novembre', 'décembre']> 
18 
19		<!-- this builds and properly formats the date in French so that it is in the format : 20 Octobre 2017 --> 
20		<#assign frenchDisplayDate = day+ " " + monthInLetters[monthIndex] + " 20" + dateArray[2]> 
21 
22		<!-- end of code used for displaying French date --> 
23      
24		<#assign article = assetRenderer.getArticle() > 
25		<#assign viewURL = assetPublisherHelper.getAssetViewURL(renderRequest, renderResponse, curEntry) /> 
26		<#if assetLinkBehavior != "showFullContent"> 
27			<#assign viewURL = assetRenderer.getURLViewInContext(renderRequest, renderResponse, viewURL) /> 
28			<#assign viewURL = viewURL +  "?inheritRedirect=true&redirect=" + currentURL/> 
29		</#if> 
30		<div class="asset-news-article"> 
31	        <h3><a href="${viewURL}">${curEntry.getTitle(locale)}</a></h3> 
32	 
33			<p> 
34				<#if locale == "fr_CA" || locale == "fr_FR"> 
35					<!--for french date formatting, example: 8 Mai 2017--> 
36					<span>${frenchDisplayDate}</span> 
37				<#else> 
38					<!--for english date formatting, example: May 8, 2017--> 
39					<span>${curEntry.getPublishDate()?date?string.long}</span> 
40				</#if> 
41			</p> 
42	          
43			<#-- To display edit content button - REMOVE BECAUSE IT DOES HAVE A PUBLISH BUTTON 
44			<#if assetRenderer.hasEditPermission(themeDisplay.getPermissionChecker())> 
45				<#assign redirectURL = renderResponse.createRenderURL() /> 
46 
47				${redirectURL.setParameter("struts_action", "/asset_publisher/add_asset_redirect")} 
48				${redirectURL.setWindowState("pop_up")} 
49 
50				<#assign editPortletURL = assetRenderer.getURLEdit(renderRequest, renderResponse, windowStateFactory.getWindowState("pop_up"), redirectURL) /> 
51 
52				<#if validator.isNotNull(editPortletURL)> 
53					<#assign title = languageUtil.format(locale, "edit-x", htmlUtil.escape(assetRenderer.getTitle(locale))) /> 
54 
55					<@liferay_ui["icon"] 
56						image="edit" 
57						message=title 
58						url="javascript:Liferay.Util.openWindow({dialog: {width: 960}, id:'" + renderResponse.getNamespace() + "editAsset', title: '" + title + "', uri:'" + htmlUtil.escapeURL(editPortletURL.toString()) + "'});" 
59					/> 
60				</#if> 
61			</#if> 
62			--> 
63		</div> 
64	</#list> 
65<#else> 
66<div class="asset-news-article"> 
67	<h3><@liferay.language key="${'mck-no-results-message'}" /></h3> 
68</div> 
69</#if>