Skip to content

Commit cbe6f16

Browse files
committed
Add check that both comparison keys are not blank
We want to know if this happens as soon as possible, as it will almost always result in operations being combined when they should not.
1 parent 29a7fd9 commit cbe6f16

File tree

1 file changed

+4
-0
lines changed
  • OneSignalSDK/onesignal/core/src/main/java/com/onesignal/core/internal/operations/impl

1 file changed

+4
-0
lines changed

OneSignalSDK/onesignal/core/src/main/java/com/onesignal/core/internal/operations/impl/OperationRepo.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,10 @@ internal class OperationRepo(
278278
val itemKey =
279279
if (startingOp.operation.groupComparisonType == GroupComparisonType.CREATE) item.operation.createComparisonKey else item.operation.modifyComparisonKey
280280

281+
if (itemKey == "" && startingKey == "") {
282+
throw Exception("Both comparison keys can not be blank!")
283+
}
284+
281285
if (itemKey == startingKey) {
282286
queue.remove(item)
283287
ops.add(item)

0 commit comments

Comments
 (0)