Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix the crash caused by the empty mListPack of NewRecordActivity #201

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,11 @@ public void onClick(View v) {
});

mListPack = MyApplication.getInstance().loadAppList();
if (mListPack.isEmpty()) {
toastShort(R.string.record__app_list_empty);
finish();
return;
}

int position = 0;
if (!StringUtil.isEmpty(app)) {
Expand Down Expand Up @@ -350,6 +355,9 @@ private void initAppHeadView() {
}
}
}
if (mListPack.isEmpty()) {
return;
}
mCurrentApp = mListPack.get(position);

updateHeadView();
Expand Down
1 change: 1 addition & 0 deletions src/app/src/main/res/values-zh/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@
<string name="record__preparing">正在准备中</string>
<string name="record__prepare_failed">环境准备失败</string>
<string name="record__case_name_empty">用例名不能为空</string>
<string name="record__app_list_empty">已安装应用列表不能为空</string>
<string name="activity__record">录制回放</string>
<string name="index__disclaimer">免责声明</string>
<string name="replay__delete_case">删除此用例?</string>
Expand Down
1 change: 1 addition & 0 deletions src/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@
<string name="record__preparing">Preparing</string>
<string name="record__prepare_failed">Environment preparing fail.</string>
<string name="record__case_name_empty">Case name should not be empty.</string>
<string name="record__app_list_empty">Installed app should not be empty.</string>
<string name="activity__record">Record &amp; Replay</string>
<string name="index__disclaimer">Disclaimer</string>
<string name="replay__delete_case">Delete?</string>
Expand Down