Skip to content

Commit 9f1727c

Browse files
henrylau-sakrizzu
authored andcommittedFeb 27, 2019
fix: do not throw on empty key list
Do not throw an error on android, when an empty key array is passed to mutliSet and multiRemove
1 parent 409f9fd commit 9f1727c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncStorageModule.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ protected void doInBackgroundGuarded(Void... params) {
196196
@ReactMethod
197197
public void multiSet(final ReadableArray keyValueArray, final Callback callback) {
198198
if (keyValueArray.size() == 0) {
199-
callback.invoke(AsyncStorageErrorUtil.getInvalidKeyError(null));
199+
callback.invoke();
200200
return;
201201
}
202202

@@ -261,7 +261,7 @@ protected void doInBackgroundGuarded(Void... params) {
261261
@ReactMethod
262262
public void multiRemove(final ReadableArray keys, final Callback callback) {
263263
if (keys.size() == 0) {
264-
callback.invoke(AsyncStorageErrorUtil.getInvalidKeyError(null));
264+
callback.invoke();
265265
return;
266266
}
267267

0 commit comments

Comments
 (0)
Please sign in to comment.