Mercurial > dive4elements > framework
diff artifact-database/src/main/java/de/intevation/artifactdatabase/Backend.java @ 432:da33275fb765
Check if roleData is null before reading it
Fix for issue849
author | Björn Ricks <bjoern.ricks@intevation.de> |
---|---|
date | Fri, 28 Sep 2012 13:55:58 +0200 |
parents | f5ecca16f601 |
children | e79ad624f94c |
line wrap: on
line diff
--- a/artifact-database/src/main/java/de/intevation/artifactdatabase/Backend.java Fri Sep 28 12:16:04 2012 +0200 +++ b/artifact-database/src/main/java/de/intevation/artifactdatabase/Backend.java Fri Sep 28 13:55:58 2012 +0200 @@ -972,7 +972,10 @@ String account = result.getString(3); byte [] roleData = result.getBytes(4); - Document role = XMLUtils.fromByteArray(roleData, true); + Document role = null; + if (roleData != null) { + role = XMLUtils.fromByteArray(roleData, true); + } user[0] = factory.createUser( identifier, name, account, role, context); @@ -1009,7 +1012,10 @@ String account = result.getString(3); byte [] roleData = result.getBytes(4); - Document role = XMLUtils.fromByteArray(roleData, true); + Document role = null; + if (roleData != null) { + role = XMLUtils.fromByteArray(roleData, true); + } user[0] = factory.createUser( identifier, name, account, role, context);