mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-18 22:26:30 +01:00
fix NPE when serializing
This commit is contained in:
parent
c333e561af
commit
e7708ef439
1 changed files with 3 additions and 2 deletions
|
@ -84,7 +84,7 @@ public class DlgState implements Parcelable {
|
|||
public void writeToParcel( Parcel out, int flags ) {
|
||||
out.writeInt( m_id.ordinal() );
|
||||
out.writeInt( m_posButton );
|
||||
out.writeInt( m_action.ordinal() );
|
||||
out.writeInt( null == m_action ? -1 : m_action.ordinal() );
|
||||
out.writeInt( m_prefsKey );
|
||||
out.writeString( m_msg );
|
||||
}
|
||||
|
@ -94,7 +94,8 @@ public class DlgState implements Parcelable {
|
|||
public DlgState createFromParcel(Parcel in) {
|
||||
DlgID id = DlgID.values()[in.readInt()];
|
||||
int posButton = in.readInt();
|
||||
Action action = Action.values()[in.readInt()];
|
||||
int tmp = in.readInt();
|
||||
Action action = 0 > tmp ? null : Action.values()[tmp];
|
||||
int prefsKey = in.readInt();
|
||||
String msg = in.readString();
|
||||
return new DlgState( id, msg, posButton, action, prefsKey );
|
||||
|
|
Loading…
Reference in a new issue