private void signOutInDB() { checkAllFieldsHandled(); ObservableList<Topics135> selectedTopics = topicsListView.getSelectionModel().getSelectedItems(); ArrayList<Topics135> arrayOfTopics = new ArrayList<>(); if (selectedTopics != null) { for (Topics135 t : selectedTopics) { arrayOfTopics.add(t); } } if (arrayOfTopics.isEmpty()) { arrayOfTopics = null; } // If not in 135, then Level of Learning will be null. Do not insert level of learning in to DB. int levelOfLearningValue = -1; if (levelOfLearning.getValue() != null) { levelOfLearningValue = levelOfLearning.getValue(); } sod = new SignOutData( student.getEmplId(), arrayOfTopics, levelOfLearningValue, theTutor.getValue()); Main.getMdb().signOut(sod); successfulSignOut = true; close(); }