diff --git a/app/src/main/java/gr/thmmy/mthmmy/activities/upload/UploadActivity.java b/app/src/main/java/gr/thmmy/mthmmy/activities/upload/UploadActivity.java index d6fb274a..dcf9b90e 100644 --- a/app/src/main/java/gr/thmmy/mthmmy/activities/upload/UploadActivity.java +++ b/app/src/main/java/gr/thmmy/mthmmy/activities/upload/UploadActivity.java @@ -940,14 +940,16 @@ public class UploadActivity extends BaseActivity { String retrievedCourse = maybeCourse.replaceAll("-", "").replace("(ΝΠΣ)", "").trim(); String retrievedSemester = maybeSemester.replaceAll("-", "").trim().substring(0, 1); - UploadsCourse foundUploadsCourse = UploadsCourse.findCourse(retrievedCourse, uploadsCourses); - - if(foundUploadsCourse != null){ - uploadsCourse = foundUploadsCourse; - semester = retrievedSemester; - Timber.d("Selected course: %s, semester: %s", uploadsCourse.getName(), semester); - titleDescriptionBuilderButton.setEnabled(true); - return; + if(!retrievedCourse.isEmpty()){ + UploadsCourse foundUploadsCourse = UploadsCourse.findCourse(retrievedCourse, uploadsCourses); + + if(foundUploadsCourse != null){ + uploadsCourse = foundUploadsCourse; + semester = retrievedSemester; + Timber.d("Selected course: %s, semester: %s", uploadsCourse.getName(), semester); + titleDescriptionBuilderButton.setEnabled(true); + return; + } } titleDescriptionBuilderButton.setEnabled(false);