fix(container/edit): fallback value when retrieving GPU config without snapshot available [EE-4110] (#7570)

pull/7586/head
LP B 2022-08-30 14:52:24 +02:00 committed by GitHub
parent c79be58700
commit 2f0dbf2ae1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -823,8 +823,8 @@ angular.module('portainer.docker').controller('CreateContainerController', [
function (d) {
var containers = d;
$scope.runningContainers = containers;
$scope.gpuUseAll = $scope.endpoint.Snapshots[0].GpuUseAll;
$scope.gpuUseList = $scope.endpoint.Snapshots[0].GpuUseList;
$scope.gpuUseAll = _.get($scope, 'endpoint.Snapshots[0].GpuUseAll', false);
$scope.gpuUseList = _.get($scope, 'endpoint.Snapshots[0].GpuUseList', []);
if ($transition$.params().from) {
loadFromContainerSpec();
} else {