Index: trunk/ippScripts/scripts/diffphot.pl
===================================================================
--- trunk/ippScripts/scripts/diffphot.pl	(revision 28428)
+++ trunk/ippScripts/scripts/diffphot.pl	(revision 28490)
@@ -252,8 +252,8 @@
 }
 
-unless ($no_update) {
+{
     my $command = "$diffphottool -diff_phot_id $diff_phot_id -skycell_id $skycell_id";
     $command .= " -done -path_base $outroot";
-    $command .= " -magicked $magicked" if $magicked;
+    $command .= " -magicked $magicked" if defined $magicked;
     $command .= " -quality $quality" if defined $quality;
     $command .= (" -dtime_script " . ((DateTime->now->mjd - $mjd_start) * 86400));
@@ -261,9 +261,13 @@
     $command .= " -dbname $dbname" if defined $dbname;
 
-    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
-        run(command => $command, verbose => $verbose);
-    unless ($success) {
-        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
-        &my_die("Command failed: $error_code", $diff_phot_id, $skycell_id, $error_code);
+    unless ($no_update) {
+        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
+            run(command => $command, verbose => $verbose);
+        unless ($success) {
+            $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+            &my_die("Command failed: $error_code", $diff_phot_id, $skycell_id, $error_code);
+        }
+    } else {
+        print "Skipping update: $command\n";
     }
 }
