Project

General

Profile

Revision 28027bed

ID28027bed8148feb8c9a3cfdbd7e203e62ad51733
Parent 0e9a6a75
Child 03e96dec

Added by Katja Luther about 4 years ago

fix #6061: add a null check for abbrevTitleCache and titleCache in comparator

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/NomenclaturalAuthorSelectionDialog.java
215 215
			public int compare(UuidAndTitleCache entity1,
216 216
					UuidAndTitleCache entity2) {
217 217
				Collator collator = Collator.getInstance();
218
				return collator.compare(entity1.getAbbrevTitleCache(), entity2.getAbbrevTitleCache());
218
				String compareString1 = "";
219
				if (entity1.getAbbrevTitleCache() != null){
220
					compareString1 = entity1.getAbbrevTitleCache();
221
				}
222
				if (entity1.getTitleCache() != null){
223
					compareString1 += entity1.getTitleCache();
224
				}
225
				
226
				
227
				String compareString2 = "";
228
				if (entity2.getAbbrevTitleCache() != null){
229
					compareString2 = entity2.getAbbrevTitleCache();
230
				}
231
				if (entity2.getTitleCache() != null){
232
					compareString2 += entity2.getTitleCache();
233
				}
234
				
235
				
236
				return collator.compare(compareString1, compareString2);
219 237
			}
220 238
		};
221 239
	}

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)