diff --git a/core/modules/views/src/Plugin/views/field/Field.php b/core/modules/views/src/Plugin/views/field/Field.php
index c9ab37a..5280b6c 100644
--- a/core/modules/views/src/Plugin/views/field/Field.php
+++ b/core/modules/views/src/Plugin/views/field/Field.php
@@ -820,9 +820,10 @@ public function getItems(ResultRow $values) {
         'settings' => $this->options['settings'],
         'label' => 'hidden',
       ];
-      $build_list = $this->createEntityForGroupBy($this->getEntity($values), $values)
-        ->{$this->definition['field_name']}
-        ->view($display);
+      // Some bundles might not have a specific field, in which case the faked
+      // entity doesn't have it either.
+      $entity = $this->createEntityForGroupBy($this->getEntity($values), $values);
+      $build_list = isset($entity->{$this->definition['field_name']}) ? $entity->{$this->definition['field_name']}->view($display) : NULL;
     }
 
     if (!$build_list) {
@@ -1002,8 +1003,17 @@ protected function getTableMapping() {
    * {@inheritdoc}
    */
   public function getValue(ResultRow $values, $field = NULL) {
+    $entity = $this->getEntity($values);
+    // Some bundles might not have a specific field, in which case the faked
+    // entity doesn't have it either.
     /** @var \Drupal\Core\Field\FieldItemListInterface $field_item_list */
-    $field_item_list = $this->getEntity($values)->{$this->definition['field_name']};
+    $field_item_list = isset($entity->{$this->definition['field_name']}) ? $entity->{$this->definition['field_name']} : NULL;
+
+    if (!isset($field_item_list)) {
+      // There isn't anything we can do without a valid field.
+      return NULL;
+    }
+
     $field_item_definition = $field_item_list->getFieldDefinition();
 
     if ($field_item_definition->getFieldStorageDefinition()->getCardinality() == 1) {
diff --git a/core/modules/views/src/Tests/QueryGroupByTest.php b/core/modules/views/src/Tests/QueryGroupByTest.php
index 2a7ae22..620e155 100644
--- a/core/modules/views/src/Tests/QueryGroupByTest.php
+++ b/core/modules/views/src/Tests/QueryGroupByTest.php
@@ -25,14 +25,14 @@ class QueryGroupByTest extends ViewKernelTestBase {
    *
    * @var array
    */
-  public static $testViews = array('test_group_by_in_filters', 'test_aggregate_count', 'test_group_by_count', 'test_group_by_count_multicardinality');
+  public static $testViews = array('test_group_by_in_filters', 'test_aggregate_count', 'test_group_by_count', 'test_group_by_count_multicardinality', 'test_group_by_field_not_within_bundle');
 
   /**
    * Modules to enable.
    *
    * @var array
    */
-  public static $modules = array('entity_test', 'system', 'field', 'user', 'language');
+  public static $modules = array('entity_test', 'system', 'field', 'user', 'language', 'image');
 
   /**
    * The storage for the test entity type.
@@ -292,4 +292,45 @@ public function testGroupByFieldWithCardinality() {
     $this->assertEqual('6', $view->getStyle()->getField(5, 'field_test'));
   }
 
+  public function testGroupByWithFieldsNotExistingOnBundle() {
+    $field_storage = FieldStorageConfig::create([
+      'type' => 'integer',
+      'field_name' => 'field_test',
+      'cardinality' => 4,
+      'entity_type' => 'entity_test_mul',
+    ]);
+    $field_storage->save();
+    $field = FieldConfig::create([
+      'field_name' => 'field_test',
+      'entity_type' => 'entity_test_mul',
+      'bundle' => 'entity_test_mul',
+    ]);
+    $field->save();
+
+    $entities = [];
+    $entity = EntityTestMul::create([
+      'field_test' => [1],
+      'type' => 'entity_test_mul',
+    ]);
+    $entity->save();
+    $entities[] = $entity;
+
+    $entity = EntityTestMul::create([
+      'type' => 'entity_test_mul2',
+    ]);
+    $entity->save();
+    $entities[] = $entity;
+
+    $view = Views::getView('test_group_by_field_not_within_bundle');
+    $this->executeView($view);
+
+    $this->assertEqual(2, count($view->result));
+    // The first result is coming from entity_test_mul2, so no field could be
+    // rendered.
+    $this->assertEqual('', $view->getStyle()->getField(0, 'field_test'));
+    // The second result is coming from entity_test_mul, so its field value
+    // could be rendered.
+    $this->assertEqual('1', $view->getStyle()->getField(1, 'field_test'));
+  }
+
 }
diff --git a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_group_by_field_not_within_bundle.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_group_by_field_not_within_bundle.yml
new file mode 100644
index 0000000..dac925b
--- /dev/null
+++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_group_by_field_not_within_bundle.yml
@@ -0,0 +1,61 @@
+langcode: en
+status: true
+dependencies: {  }
+id: test_group_by_field_not_within_bundle
+label: ''
+module: views
+description: ''
+tag: ''
+base_table: entity_test_mul_property_data
+base_field: id
+core: '8'
+display:
+  default:
+    display_options:
+      access:
+        type: none
+      cache:
+        type: tag
+      exposed_form:
+        type: basic
+      fields:
+        field_test:
+          alter:
+            alter_text: false
+            ellipsis: true
+            html: false
+            make_link: false
+            strip_tags: false
+            trim: false
+            word_boundary: true
+          group_type: group
+          group_column: value
+          empty_zero: false
+          field: field_test
+          hide_empty: false
+          id: field_test
+          table: entity_test_mul__field_test
+          entity_type: entity_test_mul
+          entity_field: field_test
+          plugin_id: field
+      sorts:
+        field_test_value:
+          table: entity_test_mul__field_test
+          field: field_test_value
+          id: field_test_value
+          entity_type: entity_test_mul
+          entity_field: field_test
+          group_type: group
+          order: ASC
+          plugin_id: standard
+      group_by: true
+      pager:
+        type: some
+      style:
+        type: default
+      row:
+        type: fields
+    display_plugin: default
+    display_title: Master
+    id: default
+    position: 0
