Use start time when crash time is not defined (fix warnings)
authorVincent Tondellier <tonton+hg@team1664.org>
Sun, 14 Feb 2016 20:17:15 +0100
changeset 95 fcf3a68002e6
parent 94 c5fcb00c7261
child 96 716c0292967c
Use start time when crash time is not defined (fix warnings)
lib/CrashTest/Plugin/Storage/Sql/Model/CrashReport.pm
--- a/lib/CrashTest/Plugin/Storage/Sql/Model/CrashReport.pm	Sun Feb 14 20:15:25 2016 +0100
+++ b/lib/CrashTest/Plugin/Storage/Sql/Model/CrashReport.pm	Sun Feb 14 20:17:15 2016 +0100
@@ -114,7 +114,7 @@
 }
 
 sub create {
-    my ($self, $uuid, $pjson, $client_info, $dmp_content) = @_;
+    my ($self, $uuid, $pjson, $client_info, $dmp_file) = @_;
 
     if(!defined($client_info->{UserID})) {
         $self->app->log->info("Invalid crash $uuid: no UserID");
@@ -129,6 +129,10 @@
     }
     if($client_info->{CrashTime}) {
         $crash_time = DateTime->from_epoch(epoch => $client_info->{CrashTime});
+    } elsif($start_time) {
+        $crash_time = $start_time;
+    } else {
+        $crash_time = DateTime->from_epoch(epoch => time());
     }
 
     chomp($client_info->{ProductName});