Skip to content

Commit eb757d9

Browse files
committed
#57: Check if categoryOrderHint value doesn't exist don't add at all.
1 parent 10a0db3 commit eb757d9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main/java/com/commercetools/sync/commons/utils/SyncUtils.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,10 @@ public static ProductDraft replaceProductDraftCategoryReferenceIdsWithKeys(@Nonn
217217
if (categoryOrderHintValue == null) {
218218
// to handle case of getting category order hints from another CTP
219219
// TODO NEEDS TO BE REFACTORED INTO OWN METHOD.
220-
categoryOrderHintsMapWithKeys.put(categoryKey, categoryOrderHints.get(categoryId));
220+
final String categoryOrderHintValueById = categoryOrderHints.get(categoryId);
221+
if (categoryOrderHintValueById != null) {
222+
categoryOrderHintsMapWithKeys.put(categoryKey, categoryOrderHintValueById);
223+
}
221224
} else {
222225
categoryOrderHintsMapWithKeys.put(categoryKey, categoryOrderHintValue);
223226
}

0 commit comments

Comments
 (0)