Skip to content

Commit

Permalink
Ignore blank message code - UIFR-140
Browse files Browse the repository at this point in the history
  • Loading branch information
dkayiwa committed Feb 5, 2014
1 parent d20da4d commit 8260d34
Showing 1 changed file with 9 additions and 0 deletions.
Expand Up @@ -19,6 +19,7 @@
import java.util.Properties;
import java.util.Set;

import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.openmrs.api.context.Context;
Expand Down Expand Up @@ -121,6 +122,10 @@ public String getMessage(MessageSourceResolvable resolvable, Locale locale) {
* java.lang.Object[], java.util.Locale)
*/
public String getMessage(String code, Object[] args, Locale locale) throws NoSuchMessageException {
if (StringUtils.isBlank(code)) {
return "";
}

return activeMessageSource.getMessage(code, args, code, locale);
}

Expand All @@ -129,6 +134,10 @@ public String getMessage(String code, Object[] args, Locale locale) throws NoSuc
* java.lang.Object[], java.lang.String, java.util.Locale)
*/
public String getMessage(String code, Object[] args, String defaultMessage, Locale locale) {
if (StringUtils.isBlank(code)) {
return "";
}

return activeMessageSource.getMessage(code, args, defaultMessage, locale);
}

Expand Down

0 comments on commit 8260d34

Please sign in to comment.