Skip to content

Commit

Permalink
LPS-21951
Browse files Browse the repository at this point in the history
  • Loading branch information
ericmin authored and brianchandotcom committed Oct 10, 2011
1 parent 575b730 commit fec295a
Showing 1 changed file with 17 additions and 1 deletion.
Expand Up @@ -14,10 +14,12 @@

package com.liferay.portlet.wiki.action;

import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.json.JSONFactoryUtil;
import com.liferay.portal.kernel.json.JSONObject;
import com.liferay.portal.kernel.language.LanguageUtil;
import com.liferay.portal.kernel.servlet.SessionErrors;
import com.liferay.portal.kernel.upload.UploadException;
import com.liferay.portal.kernel.upload.UploadPortletRequest;
import com.liferay.portal.kernel.util.Constants;
import com.liferay.portal.kernel.util.FileUtil;
Expand All @@ -26,6 +28,7 @@
import com.liferay.portal.kernel.util.ParamUtil;
import com.liferay.portal.kernel.util.StreamUtil;
import com.liferay.portal.kernel.util.TempFileUtil;
import com.liferay.portal.kernel.util.Validator;
import com.liferay.portal.security.auth.PrincipalException;
import com.liferay.portal.struts.ActionConstants;
import com.liferay.portal.theme.ThemeDisplay;
Expand Down Expand Up @@ -68,7 +71,20 @@ public void processAction(
String cmd = ParamUtil.getString(actionRequest, Constants.CMD);

try {
if (cmd.equals(Constants.ADD)) {
if (Validator.isNull(cmd)) {
UploadException uploadException =
(UploadException)actionRequest.getAttribute(
WebKeys.UPLOAD_EXCEPTION);

if (uploadException != null) {
if (uploadException.isExceededSizeLimit()) {
throw new FileSizeException(uploadException.getCause());
}

throw new PortalException(uploadException.getCause());
}
}
else if (cmd.equals(Constants.ADD)) {
addAttachment(actionRequest);
}
else if (cmd.equals(Constants.ADD_MULTIPLE)) {
Expand Down

0 comments on commit fec295a

Please sign in to comment.