File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
android-gpgs/src/de/golfgl/gdxgamesvcs Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change 19
19
import com .google .android .gms .games .Games ;
20
20
import com .google .android .gms .games .GamesActivityResultCodes ;
21
21
import com .google .android .gms .games .GamesStatusCodes ;
22
+ import com .google .android .gms .games .Player ;
22
23
import com .google .android .gms .games .achievement .Achievement ;
23
24
import com .google .android .gms .games .achievement .AchievementBuffer ;
24
25
import com .google .android .gms .games .achievement .Achievements ;
@@ -221,11 +222,13 @@ public void onConnected(@Nullable Bundle bundle) {
221
222
222
223
@ Override
223
224
public String getPlayerDisplayName () {
224
- if (isSessionActive ())
225
- return Games .Players .getCurrentPlayer (mGoogleApiClient )
226
- .getDisplayName ();
227
- else
228
- return null ;
225
+ if (isSessionActive ()) {
226
+ Player player = Games .Players .getCurrentPlayer (mGoogleApiClient );
227
+ if (player != null )
228
+ return player .getDisplayName ();
229
+ }
230
+
231
+ return null ;
229
232
}
230
233
231
234
@ Override
You can’t perform that action at this time.
0 commit comments