Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
OLAT CI-CD Testing Project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lars Oliver Dam
OLAT CI-CD Testing Project
Commits
c4d9106a
Commit
c4d9106a
authored
12 years ago
by
srosse
Browse files
Options
Downloads
Patches
Plain Diff
OO-261: fix the NPE
parent
d1bf83e7
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/org/olat/registration/RegistrationAdminController.java
+9
-9
9 additions, 9 deletions
...va/org/olat/registration/RegistrationAdminController.java
with
9 additions
and
9 deletions
src/main/java/org/olat/registration/RegistrationAdminController.java
+
9
−
9
View file @
c4d9106a
...
...
@@ -91,7 +91,7 @@ public class RegistrationAdminController extends FormBasicController {
propertyKeys
=
new
String
[
propertyHandlers
.
size
()
+
1
];
propertyValues
=
new
String
[
propertyHandlers
.
size
()
+
1
];
int
count
=
0
;
propertyKeys
[
0
]
=
""
;
propertyKeys
[
0
]
=
"
-
"
;
propertyValues
[
0
]
=
""
;
for
(
UserPropertyHandler
propertyHandler:
propertyHandlers
)
{
propertyKeys
[
1
+
count
]
=
propertyHandler
.
getName
();
...
...
@@ -152,8 +152,6 @@ public class RegistrationAdminController extends FormBasicController {
UserPropertyHandler
handler
=
userPropertiesConfig
.
getPropertyHandler
(
propertyName
);
if
(
handler
!=
null
)
{
propertyElement
.
select
(
handler
.
getName
(),
true
);
}
else
{
propertyElement
.
select
(
""
,
true
);
}
propertyElement
.
addActionListener
(
this
,
FormEvent
.
ONCHANGE
);
...
...
@@ -237,11 +235,13 @@ public class RegistrationAdminController extends FormBasicController {
String
propertyName
=
propertyElement
.
getSelectedKey
();
String
value
=
propertyValueElement
.
getValue
();
UserPropertyHandler
handler
=
userPropertiesConfig
.
getPropertyHandler
(
propertyName
);
ValidationError
validationError
=
new
ValidationError
();
boolean
valid
=
handler
.
isValidValue
(
value
,
validationError
,
getLocale
());
if
(!
valid
)
{
propertyValueElement
.
setErrorKey
(
"admin.registration.propertyValue.error"
,
null
);
allOk
&=
false
;
if
(
handler
!=
null
)
{
ValidationError
validationError
=
new
ValidationError
();
boolean
valid
=
handler
.
isValidValue
(
value
,
validationError
,
getLocale
());
if
(!
valid
)
{
propertyValueElement
.
setErrorKey
(
"admin.registration.propertyValue.error"
,
null
);
allOk
&=
false
;
}
}
}
}
...
...
@@ -262,7 +262,7 @@ public class RegistrationAdminController extends FormBasicController {
if
(
propertyElement
.
isOneSelected
())
{
registrationModule
.
setStaticPropertyMappingName
(
propertyElement
.
getSelectedKey
());
}
else
{
registrationModule
.
setStaticPropertyMappingName
(
null
);
registrationModule
.
setStaticPropertyMappingName
(
"-"
);
}
registrationModule
.
setStaticPropertyMappingValue
(
propertyValueElement
.
getValue
());
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment