Skip to content

Commit

Permalink
RN picker - fix types in AndroidDialogPickerManagerInterface
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Eddie Dugan authored and facebook-github-bot committed Mar 25, 2020
1 parent 9064c18 commit 56b0f5c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

public interface AndroidDialogPickerManagerInterface<T extends View> {
void setColor(T view, @Nullable Integer value);
void setBackgroundColor(T view, @Nullable int value);
void setBackgroundColor(T view, @Nullable Integer value);
void setEnabled(T view, boolean value);
void setItems(T view, @Nullable ReadableArray value);
void setPrompt(T view, @Nullable String value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import android.widget.Spinner;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.facebook.react.module.annotations.ReactModule;
import com.facebook.react.uimanager.ThemedReactContext;
import com.facebook.react.uimanager.ViewManagerDelegate;
Expand Down Expand Up @@ -44,7 +45,7 @@ protected ViewManagerDelegate<ReactPicker> getDelegate() {
}

@Override
public void setBackgroundColor(@NonNull ReactPicker view, int backgroundColor) {
public void setBackgroundColor(@NonNull ReactPicker view, @Nullable Integer backgroundColor) {
view.setStagedBackgroundColor(backgroundColor);
}
}

0 comments on commit 56b0f5c

Please sign in to comment.