aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/github
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/java/github')
-rw-r--r--app/src/main/java/github/daneren2005/dsub/fragments/AdminFragment.java2
-rw-r--r--app/src/main/java/github/daneren2005/dsub/util/UserUtil.java2
2 files changed, 2 insertions, 2 deletions
diff --git a/app/src/main/java/github/daneren2005/dsub/fragments/AdminFragment.java b/app/src/main/java/github/daneren2005/dsub/fragments/AdminFragment.java
index 187f0d55..552712f7 100644
--- a/app/src/main/java/github/daneren2005/dsub/fragments/AdminFragment.java
+++ b/app/src/main/java/github/daneren2005/dsub/fragments/AdminFragment.java
@@ -47,7 +47,7 @@ public class AdminFragment extends SelectRecyclerFragment<User> {
switch (item.getItemId()) {
case R.id.menu_add_user:
- UserUtil.addNewUser(context, this, objects.get(0));
+ UserUtil.addNewUser(context, this, (objects.size() > 0) ? objects.get(0) : null);
break;
}
diff --git a/app/src/main/java/github/daneren2005/dsub/util/UserUtil.java b/app/src/main/java/github/daneren2005/dsub/util/UserUtil.java
index 24d3906b..db1c628f 100644
--- a/app/src/main/java/github/daneren2005/dsub/util/UserUtil.java
+++ b/app/src/main/java/github/daneren2005/dsub/util/UserUtil.java
@@ -406,7 +406,7 @@ public final class UserUtil {
}
}
- if(sampleUser.getMusicFolderSettings() != null) {
+ if(sampleUser != null && sampleUser.getMusicFolderSettings() != null) {
for(User.Setting setting: sampleUser.getMusicFolderSettings()) {
User.MusicFolderSetting musicFolderSetting = (User.MusicFolderSetting) setting;
user.addMusicFolder(musicFolderSetting, true);