title: Call to a member function isCollection() on null
body: <p>I, using the Graphaware Neo4j-php-OGM. I would like to access the 2nd level relationship. I can't seen to get it to work. What am i doing wrong?</p>
  
  <p>I'm trying to execute the following:</p>
  
  <pre><code>public function allowToContinue($userUuid, $permissionUuid)
      {
          $userRepo = $this-&gt;entityManager-&gt;getRepository(User::class);
          $permRoleRepo = $this-&gt;entityManager-&gt;getRepository(PermRole::class);
          $permissionRepo = $this-&gt;entityManager-&gt;getRepository(Permission::class);
          $user = $userRepo-&gt;findOneBy(['uuid' =&gt; $userUuid]);
          $permission = $permissionRepo-&gt;findOneBy(['uuid' =&gt; $permissionUuid]);
          $allowed = false;
          foreach ($user-&gt;getPermrole() as $userRole)
          {
              var_dump($userRole);
              $role = $permRoleRepo-&gt;findOneBy(['uuid' =&gt; $userRole-&gt;getUuid()]);
              var_dump($role);
              foreach ($role-&gt;getPermissions() as $perm)
              {
                  var_dump($perm-&gt;getUuid());
                  if($perm-&gt;getUuid() === $permissionUuid){
                      $allowed = true;
                  }
              }
          }
          return $allowed;
      }
  </code></pre>
  
  <p>Stacktrace:</p>
  
  <pre><code>Error:
  Call to a member function isCollection() on null
  
    at vendor/graphaware/neo4j-php-ogm/src/Hydrator/EntityHydrator.php:107
    at GraphAware\Neo4j\OGM\Hydrator\EntityHydrator-&gt;hydrateSimpleRelationshipCollection('permissions', object(Result), object(neo4j_ogm_proxy_App_Entity_Generic_PermRole))
       (vendor/graphaware/neo4j-php-ogm/src/Persisters/BasicEntityPersister.php:104)
    at GraphAware\Neo4j\OGM\Persisters\BasicEntityPersister-&gt;getSimpleRelationshipCollection('permissions', object(neo4j_ogm_proxy_App_Entity_Generic_PermRole))
       (vendor/graphaware/neo4j-php-ogm/src/Proxy/NodeCollectionInitializer.php:22)
    at GraphAware\Neo4j\OGM\Proxy\NodeCollectionInitializer-&gt;initialize(object(Node), object(neo4j_ogm_proxy_App_Entity_Generic_PermRole))
       (vendor/graphaware/neo4j-php-ogm/src/Proxy/LazyCollection.php:52)
    at GraphAware\Neo4j\OGM\Proxy\LazyCollection-&gt;doInitialize()
       (vendor/doctrine/collections/lib/Doctrine/Common/Collections/AbstractLazyCollection.php:332)
    at Doctrine\Common\Collections\AbstractLazyCollection-&gt;initialize()
       (vendor/doctrine/collections/lib/Doctrine/Common/Collections/AbstractLazyCollection.php:274)
    at Doctrine\Common\Collections\AbstractLazyCollection-&gt;getIterator()
       (src/Security/RoleChecker.php:45)
    at App\Security\RoleChecker-&gt;allowToContinue('8d88d920-5ab0-11e8-a371-001c42dff143', 'd93370b0-585d-11e8-a371-001c42dff143')
       (src/Controller/Generic/UserController.php:146)
    at App\Controller\Generic\UserController-&gt;destroy('c34f1380-5ab5-11e8-a371-001c42dff143')
       (vendor/symfony/http-kernel/HttpKernel.php:149)
    at Symfony\Component\HttpKernel\HttpKernel-&gt;handleRaw(object(Request), 1)
       (vendor/symfony/http-kernel/HttpKernel.php:66)
    at Symfony\Component\HttpKernel\HttpKernel-&gt;handle(object(Request), 1, true)
       (vendor/symfony/http-kernel/Kernel.php:188)
    at Symfony\Component\HttpKernel\Kernel-&gt;handle(object(Request))
       (public/index.php:37)
  </code></pre>
  
  <p>It throws the error on the 2nd foreach loop on line: </p>
  
  <p><code>foreach ($role-&gt;getPermissions() as $perm)</code></p>
  
  <p>It's strange, working the first time correctly and not the 2nd time. Also after fetching the object again to be sure. Without this it throws the exact same notice.
  Thanks in advance!</p>
  
  <p>All code is at github: <a href="https://github.com/djkevino/Support4Neo" rel="noreferrer">https://github.com/djkevino/Support4Neo</a></p>