fix: 修复数组越界闪退问题 https://sentry.shanqu.cc/organizations/lightgame/issues/372151/?query=is%3Aunresolved+assigned%3Ame&referrer=issue-stream&statsPeriod=14d
This commit is contained in:
@ -82,13 +82,11 @@ import com.gh.gamecenter.common.retrofit.Response;
|
||||
import com.gh.gamecenter.common.utils.DialogHelper;
|
||||
import com.gh.gamecenter.common.utils.ExtensionsKt;
|
||||
import com.gh.gamecenter.common.utils.NewFlatLogUtils;
|
||||
import com.gh.gamecenter.common.utils.PermissionHelper;
|
||||
import com.gh.gamecenter.common.utils.SensorsBridge;
|
||||
import com.gh.gamecenter.common.utils.ShareUtils;
|
||||
import com.gh.gamecenter.core.AppExecutor;
|
||||
import com.gh.gamecenter.core.utils.ClassUtils;
|
||||
import com.gh.gamecenter.core.utils.DisplayUtils;
|
||||
import com.gh.gamecenter.core.utils.EmptyCallback;
|
||||
import com.gh.gamecenter.core.utils.GsonUtils;
|
||||
import com.gh.gamecenter.core.utils.MtaHelper;
|
||||
import com.gh.gamecenter.core.utils.SPUtils;
|
||||
@ -698,15 +696,18 @@ public class MainActivity extends BaseActivity {
|
||||
try {
|
||||
GameEntity gameEntity = GsonUtils.getGson().fromJson(json, new TypeToken<GameEntity>() {
|
||||
}.getType());
|
||||
DownloadEntity downloadEntity = SimulatorGameManager.findDownloadEntityByUrl(gameEntity.getApk().get(0).getUrl());
|
||||
if (downloadEntity != null) {
|
||||
File file = new File(downloadEntity.getPath());
|
||||
if (!file.exists()) {
|
||||
ToastUtils.showToast("文件已被删除,无法启动");
|
||||
return;
|
||||
}
|
||||
if (gameEntity != null) {
|
||||
String apkUrl = gameEntity.getApk().isEmpty() ? "" : gameEntity.getApk().get(0).getUrl();
|
||||
DownloadEntity downloadEntity = SimulatorGameManager.findDownloadEntityByUrl(apkUrl);
|
||||
if (downloadEntity != null) {
|
||||
File file = new File(downloadEntity.getPath());
|
||||
if (!file.exists()) {
|
||||
ToastUtils.showToast("文件已被删除,无法启动");
|
||||
return;
|
||||
}
|
||||
|
||||
SimulatorGameManager.launchSimulatorGame(downloadEntity, gameEntity);
|
||||
SimulatorGameManager.launchSimulatorGame(downloadEntity, gameEntity);
|
||||
}
|
||||
}
|
||||
} catch (JsonSyntaxException exception) {
|
||||
exception.printStackTrace();
|
||||
|
||||
Reference in New Issue
Block a user