Skip to content

Commit

Permalink
Check for valid asset before attempting to get name
Browse files Browse the repository at this point in the history
  • Loading branch information
snipe committed May 4, 2015
1 parent 527650d commit bbdbd53
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions app/views/backend/dashboard.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@
<td>{{{ $activity->adminlog->fullName() }}}</td>

<td>
@if ($activity->asset_type=="hardware")
@if (($activity->assetlog) && ($activity->asset_type=="hardware"))
{{ $activity->assetlog->showAssetName() }}
@elseif ($activity->asset_type=="software")
@elseif (($activity->licenselog) && ($activity->asset_type=="software"))
{{ $activity->licenselog->name }}
@elseif ($activity->asset_type=="accessory")
@elseif (($activity->asset_type) && ($activity->asset_type=="accessory"))
{{ $activity->accessorylog->name }}
@endif

Expand Down
14 changes: 7 additions & 7 deletions app/views/backend/reports/activity.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@
</td>
<td>

@if ($log_action->asset_type=="hardware")
{{ $log_action->assetlog->showAssetName() }}
@elseif ($log_action->asset_type=="software")
{{ $log_action->licenselog->name }}
@elseif ($log_action->asset_type=="accessory")
{{ $log_action->accessorylog->name }}
@endif
@if (($log_action->assetlog) && ($log_action->asset_type=="hardware"))
{{ $log_action->assetlog->showAssetName() }}
@elseif (($log_action->licenselog) && ($log_action->asset_type=="software"))
{{ $log_action->licenselog->name }}
@elseif (($log_action->asset_type) && ($log_action->asset_type=="accessory"))
{{ $log_action->accessorylog->name }}
@endif


</td>
Expand Down

0 comments on commit bbdbd53

Please sign in to comment.