Author: andrei_exadel
Date: 2008-02-21 10:33:07 -0500 (Thu, 21 Feb 2008)
New Revision: 6253
Modified:
trunk/sandbox/ui/fileUpload/src/main/java/org/richfaces/org/jboss/seam/ui/renderkit/FileUploadRendererBase.java
Log:
fix null pointer exception
Modified:
trunk/sandbox/ui/fileUpload/src/main/java/org/richfaces/org/jboss/seam/ui/renderkit/FileUploadRendererBase.java
===================================================================
---
trunk/sandbox/ui/fileUpload/src/main/java/org/richfaces/org/jboss/seam/ui/renderkit/FileUploadRendererBase.java 2008-02-21
15:32:46 UTC (rev 6252)
+++
trunk/sandbox/ui/fileUpload/src/main/java/org/richfaces/org/jboss/seam/ui/renderkit/FileUploadRendererBase.java 2008-02-21
15:33:07 UTC (rev 6253)
@@ -247,8 +247,19 @@
return (result != null) ? new JSLiteral(result.toString()) : null;
}
+ /**
+ * Generate component custom events functions
+ * @param context
+ * @param component
+ * @param attributeName
+ * @return
+ */
public String getAsEventHandler(FacesContext context, UIComponent component, String
attributeName) {
- return RendererUtils.getInstance().getAsEventHandler(context, component,
attributeName, "").toScript();
+ Object eventHandler = RendererUtils.getInstance().getAsEventHandler(context, component,
attributeName, "");
+ if (eventHandler != null) {
+ return eventHandler.toString();
+ }
+ return JSReference.NULL.toScript();
}
/**
Show replies by date