Skip to content
Snippets Groups Projects
Commit 8ab279fa authored by Kevin Thaller's avatar Kevin Thaller
Browse files

bug fix null pointer exception in enrollment table view

parent d970dc3e
No related branches found
No related tags found
No related merge requests found
...@@ -19,7 +19,7 @@ public class EnrollmentProperty { ...@@ -19,7 +19,7 @@ public class EnrollmentProperty {
/** /**
* The variable which stores the grade value. * The variable which stores the grade value.
*/ */
private SimpleDoubleProperty gradeProp; private SimpleStringProperty gradeProp;
/** /**
...@@ -31,7 +31,11 @@ public class EnrollmentProperty { ...@@ -31,7 +31,11 @@ public class EnrollmentProperty {
*/ */
public EnrollmentProperty(Enrollment enrollment) { public EnrollmentProperty(Enrollment enrollment) {
courseProp = new SimpleStringProperty(enrollment.getCourse().getName()); courseProp = new SimpleStringProperty(enrollment.getCourse().getName());
gradeProp = new SimpleDoubleProperty(enrollment.getGrade()); if (enrollment.getGrade() == null){
gradeProp = new SimpleStringProperty("-");
} else {
gradeProp = new SimpleStringProperty(enrollment.getGrade().toString());
}
} }
/** /**
...@@ -52,7 +56,7 @@ public class EnrollmentProperty { ...@@ -52,7 +56,7 @@ public class EnrollmentProperty {
* *
* @return the value of the gradeProp-Object. * @return the value of the gradeProp-Object.
*/ */
public double getGradeProp() { public String getGradeProp() {
return gradeProp.get(); return gradeProp.get();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment