diff --git a/sites/all/modules/contrib/ubercart/shipping/uc_quote/uc_quote.module b/sites/all/modules/contrib/ubercart/shipping/uc_quote/uc_quote.module
index bafec6c..ab2158a 100644
--- a/sites/all/modules/contrib/ubercart/shipping/uc_quote/uc_quote.module
+++ b/sites/all/modules/contrib/ubercart/shipping/uc_quote/uc_quote.module
@@ -663,7 +663,6 @@ function uc_checkout_pane_quotes($op, &$order, $form = NULL, &$form_state = NULL
           }
         }
       }
-
       if (!isset($form_state['values']['panes']['quotes']['quotes']['quote_option'])) {
         if (variable_get('uc_quote_require_quote', TRUE)) {
           form_set_error('panes][quotes][quotes][quote_option', t('You must select a shipping option before continuing.'));
@@ -674,16 +673,36 @@ function uc_checkout_pane_quotes($op, &$order, $form = NULL, &$form_state = NULL
         }
       }
 
-      $quote_option = explode('---', $form_state['values']['panes']['quotes']['quotes']['quote_option']);
-      $order->quote['method'] = $quote_option[0];
-      $order->quote['accessorials'] = $quote_option[1];
-      $methods = array_filter(module_invoke_all('uc_shipping_method'), '_uc_quote_method_enabled');
-      $method = $methods[$quote_option[0]];
+      $quote_option = $form_state['values']['panes']['quotes']['quotes']['quote_option'];
+      if(isset($form_state['values']['panes']['quotes']['quotes'][$quote_option])){ //if the selected option is avaliable
+        $quote_option = explode('---', $form_state['values']['panes']['quotes']['quotes']['quote_option']);
+        $order->quote['method'] = $quote_option[0];
+        $order->quote['accessorials'] = $quote_option[1];
+        $methods = array_filter(module_invoke_all('uc_shipping_method'), '_uc_quote_method_enabled');
+        $method = $methods[$quote_option[0]];
 
-      $label = $method['quote']['accessorials'][$quote_option[1]];
+        $label = $method['quote']['accessorials'][$quote_option[1]];
 
-      $quote_option = $form_state['values']['panes']['quotes']['quotes']['quote_option'];
-      $order->quote['rate'] = $form_state['values']['panes']['quotes']['quotes'][$quote_option]['rate'];
+        $quote_option = $form_state['values']['panes']['quotes']['quotes']['quote_option'];
+
+        $order->quote['rate'] = $form_state['values']['panes']['quotes']['quotes'][$quote_option]['rate'];
+      }
+      else{ // if the previously selected option is not avaliable (due to rules), select the first option
+        $fallback = array_shift(array_keys($form_state['values']['panes']['quotes']['quotes']));
+
+        $form['panes']['quotes']['quotes']['quote_option']['#value'] = $fallback;
+        $form['panes']['quotes']['quotes']['quote_option']['#defualt_value'] = $fallback;
+dsm($form);
+        $quote_option = explode('---', $fallback);
+        $order->quote['method'] = $quote_option[0];
+        $order->quote['accessorials'] = $quote_option[1];
+        $methods = array_filter(module_invoke_all('uc_shipping_method'), '_uc_quote_method_enabled');
+        $method = $methods[$quote_option[0]];
+
+        $label = $method['quote']['accessorials'][$quote_option[1]];
+
+        $order->quote['rate'] = $form_state['values']['panes']['quotes']['quotes'][$fallback]['rate'];
+      }
 
       $result = db_query("SELECT line_item_id FROM {uc_order_line_items} WHERE order_id = :id AND type = :type", array(':id' => $order->order_id, ':type' => 'shipping'));
       if ($lid = $result->fetchField()) {
@@ -1069,3 +1088,4 @@ function uc_quote_shipping_method_options() {
   }
   return $types;
 }
+
