Skip to content
Snippets Groups Projects
Commit 95de480b authored by srosse's avatar srosse
Browse files

OO-543: fix for unit tests

parent bbef7626
No related branches found
No related tags found
No related merge requests found
......@@ -76,28 +76,29 @@ public class BooleanColumnDescriptor extends DefaultColumnDescriptor {
* @see org.olat.core.gui.components.table.ColumnDescriptor#renderValue(org.olat.core.gui.render.StringOutput,
* int, org.olat.core.gui.render.Renderer)
*/
@Override
public void renderValue(final StringOutput sb, final int row, final Renderer renderer) {
Boolean bool = (Boolean) getModelData(row);
boolean appendNothing = bool == null;
if (appendNothing){
return;
}
String val = (bool.booleanValue() ? trueValue : falseValue);
if(StringHelper.containsNonWhitespace(val)) {
sb.append(val);
Object obj = getModelData(row);
if(obj instanceof Boolean) {
Boolean bool = (Boolean)obj;
String val = (bool.booleanValue() ? trueValue : falseValue);
if(StringHelper.containsNonWhitespace(val)) {
sb.append(val);
}
}
}
/**
* @see org.olat.core.gui.components.table.ColumnDescriptor#getAction(int)
*/
@Override
public String getAction(final int row) {
if (!hasAction) {
return null;
} else {
Boolean bool = (Boolean) getModelData(row);
Object bool = getModelData(row);
// make sure the bool is not null before checkings its value
if (bool != null && bool.booleanValue()) {
if (bool instanceof Boolean && ((Boolean)bool).booleanValue()) {
return super.getAction(row);
} else {
return null;
......
......@@ -113,8 +113,9 @@ public class BusinessGroupMailing {
if(context == null) {
context = new MailContextImpl(null, null, "[BusinessGroup:" + group.getKey() + "]");
}
MailerResult result = mailer.sendMailAsSeparateMails(context, Collections.singletonList(identity), null, template, ureqIdentity, mailing.getUuid());
String metaId = mailing != null ? mailing.getUuid() : null;
MailerResult result = mailer.sendMailAsSeparateMails(context, Collections.singletonList(identity), null, template, ureqIdentity, metaId);
if(mailing != null) {
mailing.appendResult(result);
}
......
......@@ -126,7 +126,8 @@ public class RepositoryMailing {
context = new MailContextImpl(null, null, "[RepositoryEntry:" + re.getKey() + "]");
}
MailerResult result = mailer.sendMailAsSeparateMails(context, Collections.singletonList(identity), null, template, ureqIdentity, mailing.getUuid());
String metaId = mailing == null ? null : mailing.getUuid();
MailerResult result = mailer.sendMailAsSeparateMails(context, Collections.singletonList(identity), null, template, ureqIdentity, metaId);
if(mailing != null) {
mailing.appendResult(result);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment