Skip to content

Commit 9e6e11b

Browse files
committed
Fix NPE in dictsort.
1 parent 6c78217 commit 9e6e11b

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/main/java/com/hubspot/jinjava/lib/filter/DictSortFilter.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ private static class MapEntryComparator
8888
public int compare(Entry<String, Object> o1, Entry<String, Object> o2) {
8989
Object sVal1 = sortByKey ? o1.getKey() : o1.getValue();
9090
Object sVal2 = sortByKey ? o2.getKey() : o2.getValue();
91+
if (sVal1 == null || sVal2 == null) {
92+
return 0;
93+
}
9194

9295
int result = 0;
9396

0 commit comments

Comments
 (0)