fix different crashes

This commit is contained in:
Phillip Thelen 2016-03-22 18:33:24 +01:00
parent f889c5086b
commit 337d343d0f
3 changed files with 6 additions and 6 deletions

View file

@ -613,7 +613,7 @@ public class TaskFormActivity extends BaseActivity implements AdapterView.OnItem
for(TaskTag tt : task.getTags()){
int tagNameLocation = tags.indexOf(tt.getTag().getId());
if (tagsName.size() > tagNameLocation) {
if (tagsName.size() > tagNameLocation && tagNameLocation > 0) {
for(CheckBox box : allTags){
if(tagsName.get(tagNameLocation) == box.getText()){
box.setChecked(true);
@ -714,7 +714,9 @@ public class TaskFormActivity extends BaseActivity implements AdapterView.OnItem
if(!userSelectedTags.isEmpty()){
for(CharSequence names : userSelectedTags){
int tagIdLocation = tagsName.indexOf(names);
userSelectedTagIds.add(tags.get(tagIdLocation)); //used for the SQL command
if (tagIdLocation > 0) {
userSelectedTagIds.add(tags.get(tagIdLocation)); //used for the SQL command
}
}
}

View file

@ -18,7 +18,7 @@ public class AccountDetailsFragment extends BasePreferencesFragment {
protected void setupPreferences() {
for (Map.Entry<String, ?> preference : getPreferenceScreen().getSharedPreferences().getAll().entrySet()) {
String key = preference.getKey();
if (getAccountDetailsPreferences().contains(key)) {
if (getAccountDetailsPreferences().contains(key) && preference.getValue() != null) {
findPreference(key).setSummary(preference.getValue().toString());
}
}

View file

@ -37,6 +37,7 @@ public class GuildFragment extends BaseMainFragment implements Callback<Group> {
public void setGuild(Group guild) {
this.guild = guild;
mAPIHelper.apiService.getGroup(this.guild.id, this);
if (this.guildInformationFragment != null) {
this.guildInformationFragment.setGroup(guild);
}
@ -55,9 +56,6 @@ public class GuildFragment extends BaseMainFragment implements Callback<Group> {
final ContentCache contentCache = new ContentCache(mAPIHelper.apiService);
// Get the full group data
mAPIHelper.apiService.getGroup(this.guild.id, this);
setViewPagerAdapter();
return v;