summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSidharth Singh2012-12-12 09:13:17 (EST)
committer Stephan Born2013-01-25 12:35:38 (EST)
commitd1b7a71a108195349b5326f73cc8315e11afbddf (patch)
treef7bb275bc88de5d16fe394b1e2ced0f9afa04003
parentf538b5b2619e291fc7196439183f02093f64e555 (diff)
downloadorg.eclipse.stardust.ui.web-d1b7a71a108195349b5326f73cc8315e11afbddf.zip
org.eclipse.stardust.ui.web-d1b7a71a108195349b5326f73cc8315e11afbddf.tar.gz
org.eclipse.stardust.ui.web-d1b7a71a108195349b5326f73cc8315e11afbddf.tar.bz2
Jira-ID: CRNT-27336
Added a null check in MyPicturePreferenceBean hasValidFileExtension() git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ui.web@61544 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/common/MyPicturePreferenceBean.java12
1 files changed, 7 insertions, 5 deletions
diff --git a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/common/MyPicturePreferenceBean.java b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/common/MyPicturePreferenceBean.java
index 6cccc7f..3a00012 100644
--- a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/common/MyPicturePreferenceBean.java
+++ b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/common/MyPicturePreferenceBean.java
@@ -336,15 +336,17 @@ public class MyPicturePreferenceBean
*/
private boolean hasValidFileExtension(final String filePath, final ActionEvent event)
{
- String extn = filePath.substring(filePath.lastIndexOf("."));
- for (String ex : VALID_IMAGE_FILE_EXTENSIONS)
+ if (null != filePath)
{
- if (ex.equalsIgnoreCase(extn))
+ String extn = filePath.substring(filePath.lastIndexOf("."));
+ for (String ex : VALID_IMAGE_FILE_EXTENSIONS)
{
- return true;
+ if (ex.equalsIgnoreCase(extn))
+ {
+ return true;
+ }
}
}
-
/* If not a valid extension display an error message. */
FacesMessage message = new FacesMessage();
message.setSeverity(FacesMessage.SEVERITY_ERROR);