fix: New games get "adventure" as genre

Previously the genre was  empty if you didn't explicitly select a value
in the genre drop down box before saving.
This commit is contained in:
lantzelot-swe 2021-10-28 14:46:04 +02:00
parent 02a12e0df5
commit 5d276fc2b7
1 changed files with 2 additions and 1 deletions

View File

@ -486,7 +486,8 @@ public class MainViewModel extends AbstractModel
updatedGame.setAuthor(infoModel.getAuthor().replace("\"", "\"\""));
updatedGame.setYear(infoModel.getYear());
updatedGame.setComposer(infoModel.getComposer().replace("\"", "\"\""));
updatedGame.setGenre(infoModel.getGenre());
//If no genre selected use "adventure".
updatedGame.setGenre(infoModel.getGenre().isEmpty() ? "adventure" : infoModel.getGenre());
updatedGame.setDescription(infoModel.getDescription().replace("\"", "\"\""));
updatedGame.setDescriptionDe(infoModel.getDescriptionDe().replace("\"", "\"\""));
updatedGame.setDescriptionFr(infoModel.getDescriptionFr().replace("\"", "\"\""));