Closed GHLasse closed 6 years ago
If printer has not been used yet, loading the issues page for that printer results in an error for
$lastPrint=$printer->prints()->orderBy('updated_at', 'desc')->first(); $lastJob=$lastPrint->jobs()->first(); if($lastJob->requested_online == 0){ $lastUser = $lastJob->customer_name; $lastUserEmail = $lastJob->customer_email; } else { $lastUser = $lastPrint->staff_started->first_name.' '.$lastPrint->staff_started->last_name; $lastUserEmail = $lastPrint->staff_started->email; }
because $lastPrint will be null should instead be
null
$lastPrint=$printer->prints()->orderBy('updated_at', 'desc')->first(); if($lastPrint){ $lastJob=$lastPrint->jobs()->first(); if($lastJob->requested_online == 0){ $lastUser = $lastJob->customer_name; $lastUserEmail = $lastJob->customer_email; } else { $lastUser = $lastPrint->staff_started->first_name.' '.$lastPrint->staff_started->last_name; $lastUserEmail = $lastPrint->staff_started->email; } }else{ $lastUser = "--"; $lastUserEmail = ""; }
This issue is back again in the latest version. I guess someone overwrote the changes when merging. The same fix will work again though :-)
If printer has not been used yet, loading the issues page for that printer results in an error for
because $lastPrint will be
null
should instead be