Skip to content

Commit 61370c2

Browse files
committed
Fix ClassCastException inside MaskedEditText
In MaskedEditText class was an unchecked cast inside onRestoreInstanceState function. Bundle was cast to Parcelable.
1 parent a351b39 commit 61370c2

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

MaskedEditText/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apply plugin: 'com.android.library'
22
apply plugin: 'com.github.dcendents.android-maven'
33

4-
String projectVersion = "1.0.9"
4+
String projectVersion = "1.0.11"
55
String projectGroup = "ru.egslava"
66

77
version = projectVersion

MaskedEditText/src/main/java/br/com/sapereaude/maskedEditText/MaskedEditText.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,11 @@ public Parcelable onSaveInstanceState() {
100100

101101
@Override
102102
public void onRestoreInstanceState(Parcelable state) {
103+
if (!(state instanceof Bundle)) {
104+
super.onRestoreInstanceState(state);
105+
return;
106+
}
107+
103108
Bundle bundle = (Bundle) state;
104109
keepHint = bundle.getBoolean("keepHint", false);
105110
super.onRestoreInstanceState(((Bundle) state).getParcelable("super"));

0 commit comments

Comments
 (0)