Skip to content

Commit 56b0f5c

Browse files
Eddie Duganfacebook-github-bot
Eddie Dugan
authored andcommitted
RN picker - fix types in AndroidDialogPickerManagerInterface
Summary: according to [this crash report](https://our.intern.facebook.com/intern/logview/details/facebook_android_crashes/7ba7056481015482c6166d65cb97e49d/?trace_key=1506fe36a70dd5e50cdc8968f6317f27), `value` was throwing an NPE despite being null-checked. this is because it was an `int` rather than an `Integer`, so the null check wasn't working Changelog: Fix types in AndroidDialogPickerManagerInterface Reviewed By: mdvacca Differential Revision: D20646343 fbshipit-source-id: a27587e0a48f5782bcf5ffddb604018218e65206
1 parent 9064c18 commit 56b0f5c

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

ReactAndroid/src/main/java/com/facebook/react/viewmanagers/AndroidDialogPickerManagerInterface.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
public interface AndroidDialogPickerManagerInterface<T extends View> {
1717
void setColor(T view, @Nullable Integer value);
18-
void setBackgroundColor(T view, @Nullable int value);
18+
void setBackgroundColor(T view, @Nullable Integer value);
1919
void setEnabled(T view, boolean value);
2020
void setItems(T view, @Nullable ReadableArray value);
2121
void setPrompt(T view, @Nullable String value);

ReactAndroid/src/main/java/com/facebook/react/views/picker/ReactDialogPickerManager.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
import android.widget.Spinner;
1111
import androidx.annotation.NonNull;
12+
import androidx.annotation.Nullable;
1213
import com.facebook.react.module.annotations.ReactModule;
1314
import com.facebook.react.uimanager.ThemedReactContext;
1415
import com.facebook.react.uimanager.ViewManagerDelegate;
@@ -44,7 +45,7 @@ protected ViewManagerDelegate<ReactPicker> getDelegate() {
4445
}
4546

4647
@Override
47-
public void setBackgroundColor(@NonNull ReactPicker view, int backgroundColor) {
48+
public void setBackgroundColor(@NonNull ReactPicker view, @Nullable Integer backgroundColor) {
4849
view.setStagedBackgroundColor(backgroundColor);
4950
}
5051
}

0 commit comments

Comments
 (0)