@@ -128,15 +128,15 @@ public Class getShadowNodeClass() {
128128 @ Override
129129 protected ReactSlider createViewInstance (ThemedReactContext context ) {
130130 ReactSlider slider = new ReactSlider (context , null , STYLE );
131-
131+
132132 if (Build .VERSION .SDK_INT >= 21 ) {
133- /**
133+ /**
134134 * The "splitTrack" parameter should have "false" value,
135135 * otherwise the SeekBar progress line doesn't appear when it is rotated.
136136 */
137137 slider .setSplitTrack (false );
138138 }
139-
139+
140140 return slider ;
141141 }
142142
@@ -169,10 +169,12 @@ public void setStep(ReactSlider view, double value) {
169169
170170 @ ReactProp (name = "thumbTintColor" , customType = "Color" )
171171 public void setThumbTintColor (ReactSlider view , Integer color ) {
172- if (color == null ) {
173- view .getThumb ().clearColorFilter ();
174- } else {
175- view .getThumb ().setColorFilter (color , PorterDuff .Mode .SRC_IN );
172+ if (view .getThumb () != null ) {
173+ if (color == null ) {
174+ view .getThumb ().clearColorFilter ();
175+ } else {
176+ view .getThumb ().setColorFilter (color , PorterDuff .Mode .SRC_IN );
177+ }
176178 }
177179 }
178180
@@ -206,7 +208,7 @@ public void setMaximumTrackTintColor(ReactSlider view, Integer color) {
206208 background .setColorFilter (color , PorterDuff .Mode .SRC_IN );
207209 }
208210 }
209-
211+
210212 @ ReactProp (name = "inverted" , defaultBoolean = false )
211213 public void setInverted (ReactSlider view , boolean inverted ) {
212214 if (inverted ) view .setScaleX (-1f );
0 commit comments