--- rewrite.inc.orig	2013-03-10 15:52:38.498725230 +0200
+++ rewrite.inc	2013-03-10 16:00:59.806692782 +0200
@@ -32,6 +32,12 @@
     }
   }
 
+  $form['check_if_not_empty'] = array(
+    '#type' => 'checkbox',
+    '#title' => t('Perform rewrite only if this field is not empty'),
+    '#default_value' => isset($settings['check_if_not_empty']) ? $settings['check_if_not_empty'] : FALSE,
+    '#description' => t('If checked, rewrite action will execute only if this field is not empty.'),
+  );
   $form['text'] = array(
     '#type' => 'textarea',
     '#title' => t('Replacement pattern'),
@@ -48,6 +54,8 @@
 }
 
 function feeds_tamper_rewrite_callback($result, $item_key, $element_key, &$field, $settings, $source) {
+  if ($settings['check_if_not_empty'] && empty($field)) return;
+
   $trans = array();
   $item = $result->items[$item_key];
   foreach ($item as $key => $value) {
