imports leaned
[RRRRHHHH_Code] / ruralHouses / src / gui / HouseFeaturesGUI.java
index ecc44ab..ba912b1 100644 (file)
@@ -26,7 +26,6 @@ import businessLogic.BookingManager;
 import domain.Booking;
 import domain.Offer;
 import domain.RuralHouse;
-import exceptions.OfferCanNotBeBooked;
 
 public class HouseFeaturesGUI extends JFrame {
 
@@ -244,11 +243,12 @@ public class HouseFeaturesGUI extends JFrame {
                //RegExp to see if telephone number is correct??TODO
                Booking book = null;
                try {
-                       book = bookingM.createBooking(rh, rh.offers.get(row).getFirstDay(), rh.offers.get(row).getLastDay(), telIn.getText());
-               } catch (OfferCanNotBeBooked e) {
+                       if (table.getRowCount()!=0)
+                               book = bookingM.createBooking(rh, rh.offers.get(row).getFirstDay(), rh.offers.get(row).getLastDay(), telIn.getText());
+               } catch (Exception e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
-               }
+               } 
                if (book != null) {
                        BookRuralHouseConfirmationWindow confirmWindow = new BookRuralHouseConfirmationWindow(
                                        book);