Skip to content
Snippets Groups Projects
Commit c541adc2 authored by Yas Naoi's avatar Yas Naoi Committed by Yas Naoi
Browse files

Issue #3179743 by yas: Fix an Internal Server Error: Call to a member function...

Issue #3179743 by yas: Fix an Internal Server Error: Call to a member function id() on null in aws_cloud_entity_operation() (OpenStack)
parent 7ed2c3a2
No related branches found
No related tags found
No related merge requests found
......@@ -949,6 +949,7 @@ function openstack_entity_operation(EntityInterface $entity) {
if ($entity->getEntityTypeId() === 'openstack_volume') {
if ($account->hasPermission('edit any openstack volume')
|| ($account->hasPermission('edit own openstack volume')
&& !empty($entity->getOwner())
&& $account->id() === $entity->getOwner()->id())) {
if ($entity->getState() === 'available') {
$operations['attach'] = [
......@@ -983,6 +984,7 @@ function openstack_entity_operation(EntityInterface $entity) {
elseif ($entity->getEntityTypeId() === 'openstack_floating_ip') {
if ($account->hasPermission('edit any openstack floating ip')
|| ($account->hasPermission('edit own openstack floating ip')
&& !empty($entity->getOwner())
&& $account->id() === $entity->getOwner()->id())) {
if ($entity->getAssociationId() === NULL) {
$operations['associate'] = [
......@@ -1016,6 +1018,7 @@ function openstack_entity_operation(EntityInterface $entity) {
elseif ($entity->getEntityTypeId() === 'openstack_instance') {
if ($account->hasPermission('edit any openstack instance')
|| ($account->hasPermission('edit own openstack instance')
&& !empty($entity->getOwner())
&& $account->id() === $entity->getOwner()->id())) {
if ($entity->getInstanceState() === 'running') {
$operations['stop'] = [
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment