Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/models/runtime/process_model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ def started_command
def run_action_user
return user if user.present?

docker? ? docker_run_action_user : AppModel::DEFAULT_CONTAINER_USER
app&.docker? ? docker_run_action_user : AppModel::DEFAULT_CONTAINER_USER
end

def specified_or_detected_command
Expand Down
11 changes: 11 additions & 0 deletions spec/unit/models/runtime/process_model_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -747,6 +747,17 @@ def act_as_cf_admin
end
end
end

context 'when the associated app is nil' do
before do
process.app = nil
end

it 'does not raise an error and returns nil' do
expect { process.run_action_user }.not_to raise_error
expect(process.run_action_user).to eq('vcap')
end
end
end

describe '#specified_or_detected_command' do
Expand Down