File tree 1 file changed +21
-3
lines changed
src/main/java/com/parallax/server/blocklyprop/services/impl
1 file changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -54,12 +54,25 @@ public void setConfiguration(Configuration configuration) {
54
54
55
55
@ Override
56
56
public User getUser (Long idUser ) {
57
- return userDao .getUser (idUser ).into (User .class );
57
+ if (userDao != null ) {
58
+ return userDao .getUser (idUser ).into (User .class );
59
+ }
60
+ else {
61
+ LOG .error ("UserDAO is not initialized before first use!" );
62
+ return null ;
63
+ }
64
+
58
65
}
59
66
60
67
@ Override
61
68
public List <UserRecord > getAllUsers () {
62
- return userDao .getAll ();
69
+ if (userDao != null ) {
70
+ return userDao .getAll ();
71
+ }
72
+ else {
73
+ LOG .error ("UserDAO is not initialized before first use!" );
74
+ return null ;
75
+ }
63
76
}
64
77
65
78
@ Override
@@ -68,7 +81,12 @@ public String getUserScreenName(Long idUser) {
68
81
String name = "" ;
69
82
70
83
try {
71
- name = userDao .getUser (idUser ).getScreenname ();
84
+ if (userDao != null ) {
85
+ name = userDao .getUser (idUser ).getScreenname ();
86
+ }
87
+ else {
88
+ LOG .error ("UserDAO is not initialized before first use!" );
89
+ }
72
90
}
73
91
catch (NullPointerException ex ) {
74
92
LOG .error ("Error retreiving name for userID: {}" , idUser );
You can’t perform that action at this time.
0 commit comments