Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Genesys PGR
Genesys Backend
Commits
9bd483f5
Commit
9bd483f5
authored
Jul 07, 2016
by
Matija Obreza
Browse files
Fixed
#53
: error "cropName must be a String" reported when null is provided
parent
d4c814d7
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/genesys2/server/service/impl/BatchRESTServiceImpl.java
View file @
9bd483f5
...
...
@@ -559,10 +559,6 @@ public class BatchRESTServiceImpl implements BatchRESTService {
private
boolean
updateCrop
(
Accession
accession
,
JsonNode
value
)
throws
RESTApiDataTypeException
{
if
(
value
!=
null
)
{
if
(!
value
.
isTextual
())
{
throw
new
RESTApiDataTypeException
(
"cropName must be a String"
);
}
if
(
value
.
isNull
())
{
if
(!
StringUtils
.
equals
(
null
,
accession
.
getCropName
()))
{
accession
.
setCropName
(
null
);
...
...
@@ -571,6 +567,10 @@ public class BatchRESTServiceImpl implements BatchRESTService {
}
}
if
(!
value
.
isTextual
())
{
throw
new
RESTApiDataTypeException
(
"cropName must be a String"
);
}
final
String
cropName
=
value
.
textValue
().
trim
();
if
(!
StringUtils
.
equals
(
cropName
,
accession
.
getCropName
()))
{
accession
.
setCropName
(
cropName
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment