@@ -24,10 +24,10 @@ class ParseUser extends ParseObject implements ParseCloneable {
24
24
autoSendSessionId: true ,
25
25
debug: debug,
26
26
) {
27
- this .username = username;
28
- this .emailAddress = emailAddress;
29
- this .password = password;
30
- this .sessionToken = sessionToken;
27
+ if (username != null ) this .username = username;
28
+ if (emailAddress != null ) this .emailAddress = emailAddress;
29
+ if (password != null ) this .password = password;
30
+ if (sessionToken != null ) this .sessionToken = sessionToken;
31
31
}
32
32
33
33
ParseUser .forQuery () : super (keyClassUser);
@@ -51,8 +51,7 @@ class ParseUser extends ParseObject implements ParseCloneable {
51
51
set password (String ? password) {
52
52
if (_password != password) {
53
53
_password = password;
54
- if (password != null )
55
- _unsavedChanges[keyVarPassword] = password;
54
+ if (password != null ) _unsavedChanges[keyVarPassword] = password;
56
55
}
57
56
}
58
57
@@ -111,7 +110,8 @@ class ParseUser extends ParseObject implements ParseCloneable {
111
110
///
112
111
/// Uses token to get the latest version of the user. Prefer this to [getCurrentUserFromServer]
113
112
/// if using custom ParseUser object
114
- Future <ParseResponse ?> getUpdatedUser ({bool ? debug, ParseClient ? client}) async {
113
+ Future <ParseResponse > getUpdatedUser (
114
+ {bool ? debug, ParseClient ? client}) async {
115
115
final bool _debug = isDebugEnabled (objectLevelDebug: debug);
116
116
final ParseClient _client = client ??
117
117
ParseCoreData ().clientCreator (
@@ -120,7 +120,8 @@ class ParseUser extends ParseObject implements ParseCloneable {
120
120
121
121
// We can't get the current user and session without a sessionId
122
122
if ((ParseCoreData ().sessionId == null ) && (sessionToken == null )) {
123
- return null ;
123
+ ///return null;
124
+ throw 'can not get the current user and session without a sessionId' ;
124
125
}
125
126
126
127
final Map <String , String > headers = < String , String > {};
@@ -192,7 +193,7 @@ class ParseUser extends ParseObject implements ParseCloneable {
192
193
options: ParseNetworkOptions (headers: < String , String > {
193
194
keyHeaderRevocableSession: '1' ,
194
195
if (installationId != null && ! doNotSendInstallationID)
195
- keyHeaderInstallationId: installationId,
196
+ keyHeaderInstallationId: installationId,
196
197
}),
197
198
data: body);
198
199
@@ -274,7 +275,10 @@ class ParseUser extends ParseObject implements ParseCloneable {
274
275
/// Set [doNotSendInstallationID] to 'true' in order to prevent the SDK from sending the installationID to the Server.
275
276
/// This option is especially useful if you are running you application on web and you don't have permission to add 'X-Parse-Installation-Id' as an allowed header on your parse-server.
276
277
static Future <ParseResponse > loginWith (String provider, Object authData,
277
- {bool doNotSendInstallationID = false , String ? username, String ? password, String ? email}) async {
278
+ {bool doNotSendInstallationID = false ,
279
+ String ? username,
280
+ String ? password,
281
+ String ? email}) async {
278
282
final ParseUser user = ParseUser .createUser (username, password, email);
279
283
final ParseResponse response = await user._loginWith (provider, authData,
280
284
doNotSendInstallationID: doNotSendInstallationID);
0 commit comments