Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiles Parker2014-10-28 16:43:51 -0400
committerMiles Parker2014-10-28 16:44:49 -0400
commitabfaa73eca9a4744aff89cdac82057c49719f7cb (patch)
tree4c7aa6342bb513647bc30345466807bef8aebd04
parent18cade8fe4d945530e04ae8ac65aae38728e28ae (diff)
downloadorg.eclipse.mylyn.tasks-abfaa73eca9a4744aff89cdac82057c49719f7cb.tar.gz
org.eclipse.mylyn.tasks-abfaa73eca9a4744aff89cdac82057c49719f7cb.tar.xz
org.eclipse.mylyn.tasks-abfaa73eca9a4744aff89cdac82057c49719f7cb.zip
Fix attachment sorter assumes all attachments have creators
Change-Id: I37a8a8949ae368caf152ef82ef4617677a74e641 Signed-off-by: Miles Parker <milesparker@gmail.com>
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorAttachmentPart.java12
1 files changed, 7 insertions, 5 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorAttachmentPart.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorAttachmentPart.java
index bbc8b2a4a..0c3ddddb8 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorAttachmentPart.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorAttachmentPart.java
@@ -98,7 +98,9 @@ public class TaskEditorAttachmentPart extends AbstractTaskEditorPart {
case 2:
return CoreUtil.compare(attachment1.getLength(), attachment2.getLength());
case 3:
- return CoreUtil.compare(attachment1.getAuthor().toString(), attachment2.getAuthor().toString());
+ String author1 = attachment1.getAuthor() != null ? attachment1.getAuthor().toString() : null;
+ String author2 = attachment2.getAuthor() != null ? attachment2.getAuthor().toString() : null;
+ return CoreUtil.compare(author1, author2);
case 4:
return CoreUtil.compare(attachment1.getCreationDate(), attachment2.getCreationDate());
case 5:
@@ -178,10 +180,10 @@ public class TaskEditorAttachmentPart extends AbstractTaskEditorPart {
attachmentsTable.setHeaderVisible(true);
attachmentsTable.setLayout(new GridLayout());
GridDataFactory.fillDefaults()
- .align(SWT.FILL, SWT.FILL)
- .grab(true, false)
- .hint(500, SWT.DEFAULT)
- .applyTo(attachmentsTable);
+ .align(SWT.FILL, SWT.FILL)
+ .grab(true, false)
+ .hint(500, SWT.DEFAULT)
+ .applyTo(attachmentsTable);
attachmentsTable.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TREE_BORDER);
for (int i = 0; i < attachmentsColumns.length; i++) {

Back to the top