diff options
author | Simon Rettberg | 2018-06-13 14:20:03 +0200 |
---|---|---|
committer | Simon Rettberg | 2018-06-13 14:20:03 +0200 |
commit | 911144ee9dc0cec15886d379df24eef53ee3d3a3 (patch) | |
tree | 4813a2dc786b2dd2cc1f99ed9c0dd111c6d0915c /dozentenmodulserver | |
parent | [client] Change JDatePicker Lib (diff) | |
download | tutor-module-911144ee9dc0cec15886d379df24eef53ee3d3a3.tar.gz tutor-module-911144ee9dc0cec15886d379df24eef53ee3d3a3.tar.xz tutor-module-911144ee9dc0cec15886d379df24eef53ee3d3a3.zip |
[server] Don't wipe network shares if client didn't set field
Old clients wouldn't know about network shares and happily
wipe the list every time the user edits a lecture.
Diffstat (limited to 'dozentenmodulserver')
-rw-r--r-- | dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/database/mappers/DbLecture.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/database/mappers/DbLecture.java b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/database/mappers/DbLecture.java index e7a1299c..32124899 100644 --- a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/database/mappers/DbLecture.java +++ b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/database/mappers/DbLecture.java @@ -118,7 +118,9 @@ public class DbLecture { stmt.setString("ownerid", user.userId); stmt.executeUpdate(); writeLocations(connection, lectureId, lecture.locationIds); - DbNetshare.writeNetworkShares(connection, lectureId, lecture.networkShares); + if (lecture.isSetNetworkShares()) { + DbNetshare.writeNetworkShares(connection, lectureId, lecture.networkShares); + } connection.commit(); return lectureId; } catch (SQLException e) { @@ -140,7 +142,9 @@ public class DbLecture { + " WHERE lectureid = :lectureid"); setWriteFields(stmt, lectureId, lecture, user); writeLocations(connection, lectureId, lecture.locationIds); - DbNetshare.writeNetworkShares(connection, lectureId, lecture.networkShares); + if (lecture.isSetNetworkShares()) { + DbNetshare.writeNetworkShares(connection, lectureId, lecture.networkShares); + } stmt.executeUpdate(); } |