Skip to content

Instantly share code, notes, and snippets.

@labboy0276
Last active December 7, 2021 15:09
Show Gist options
  • Save labboy0276/c1e92e049ab392c7fe1c39187dac7716 to your computer and use it in GitHub Desktop.
Save labboy0276/c1e92e049ab392c7fe1c39187dac7716 to your computer and use it in GitHub Desktop.
Addresses Attempt to assign property "id" on null in phar:///usr/local/bin/terminus/src/Collections/TerminusCollection.php
diff --git a/src/Collections/TerminusCollection.php b/src/Collections/TerminusCollection.php
index 4f583f50..07443b1f 100644
--- a/src/Collections/TerminusCollection.php
+++ b/src/Collections/TerminusCollection.php
@@ -91,6 +91,10 @@ abstract class TerminusCollection implements ContainerAwareInterface, RequestAwa
public function fetch()
{
foreach ($this->getData() as $id => $model_data) {
+ if ($model_data === NULL) {
+ continue;
+ }
+
if (!isset($model_data->id)) {
$model_data->id = $id;
}
diff --git a/src/Models/Environment.php b/src/Models/Environment.php
index 677cfb51..a51fe24c 100755
--- a/src/Models/Environment.php
+++ b/src/Models/Environment.php
@@ -904,7 +904,7 @@ class Environment extends TerminusModel implements ContainerAwareInterface, Site
}
);
$domain = array_pop($domains);
- $response = $this->request()->request("http://{$domain->id}/pantheon_healthcheck");
+ $response = $this->request()->request("https://{$domain->id}/pantheon_healthcheck");
return [
'success' => ($response['status_code'] === 200),
'styx' => $response['headers']['X-Pantheon-Styx-Hostname'],
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment