From f8d4b1fd3484e0503db494e3bae2d3362a244972 Mon Sep 17 00:00:00 2001 From: eehouse Date: Sat, 8 May 2010 15:24:13 +0000 Subject: [PATCH] fix NPE: scores array isn't always there --- .../src/org/eehouse/android/xw4/jni/CurGameInfo.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/CurGameInfo.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/CurGameInfo.java index e04187368..bebe0f4be 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/CurGameInfo.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/CurGameInfo.java @@ -213,11 +213,9 @@ public class CurGameInfo { { StringBuffer sb = new StringBuffer(); String vsString = context.getString( R.string.vs ); - String tmp; - int ii; - for ( ii = 0; ; ) { - sb.append( String.format( "%s(%d)", players[ii].name, - summary.scores[ii] ) ); + for ( int ii = 0; ; ) { + int score = null == summary.scores? 0 : summary.scores[ii]; + sb.append( String.format( "%s(%d)", players[ii].name, score ) ); if ( ++ii >= nPlayers ) { break; }