{"action":"created","issue":{"url":"https://api.github.com/repos/technosophos/querypath/issues/162","labels_url":"https://api.github.com/repos/technosophos/querypath/issues/162/labels{/name}","comments_url":"https://api.github.com/repos/technosophos/querypath/issues/162/comments","events_url":"https://api.github.com/repos/technosophos/querypath/issues/162/events","html_url":"https://github.com/technosophos/querypath/issues/162","id":72271753,"number":162,"title":"Fatal error when using ->after() with empty string","user":{"login":"aaemnnosttv","id":1621608,"avatar_url":"https://avatars.githubusercontent.com/u/1621608?v=3","gravatar_id":"","url":"https://api.github.com/users/aaemnnosttv","html_url":"https://github.com/aaemnnosttv","followers_url":"https://api.github.com/users/aaemnnosttv/followers","following_url":"https://api.github.com/users/aaemnnosttv/following{/other_user}","gists_url":"https://api.github.com/users/aaemnnosttv/gists{/gist_id}","starred_url":"https://api.github.com/users/aaemnnosttv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaemnnosttv/subscriptions","organizations_url":"https://api.github.com/users/aaemnnosttv/orgs","repos_url":"https://api.github.com/users/aaemnnosttv/repos","events_url":"https://api.github.com/users/aaemnnosttv/events{/privacy}","received_events_url":"https://api.github.com/users/aaemnnosttv/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-30T20:24:40Z","updated_at":"2015-05-01T02:27:00Z","closed_at":null,"body":"This code will produce a fatal error if `$insert` is empty.\r\n\r\n```php\r\n$content = htmlqp($html);\r\n$content->find('>p')->eq($insert_index)->after($insert);\r\n```\r\n\r\n```\r\nFatal error: Call to a member function cloneNode() on a non-object\r\nQuerypath/QueryPath/DOMQuery.php on line 1439\r\n```\r\n\r\n--\r\nQueryPath 3.0.3"},"comment":{"url":"https://api.github.com/repos/technosophos/querypath/issues/comments/98028362","html_url":"https://github.com/technosophos/querypath/issues/162#issuecomment-98028362","issue_url":"https://api.github.com/repos/technosophos/querypath/issues/162","id":98028362,"user":{"login":"technosophos","id":89193,"avatar_url":"https://avatars.githubusercontent.com/u/89193?v=3","gravatar_id":"","url":"https://api.github.com/users/technosophos","html_url":"https://github.com/technosophos","followers_url":"https://api.github.com/users/technosophos/followers","following_url":"https://api.github.com/users/technosophos/following{/other_user}","gists_url":"https://api.github.com/users/technosophos/gists{/gist_id}","starred_url":"https://api.github.com/users/technosophos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/technosophos/subscriptions","organizations_url":"https://api.github.com/users/technosophos/orgs","repos_url":"https://api.github.com/users/technosophos/repos","events_url":"https://api.github.com/users/technosophos/events{/privacy}","received_events_url":"https://api.github.com/users/technosophos/received_events","type":"User","site_admin":false},"created_at":"2015-05-01T02:27:00Z","updated_at":"2015-05-01T02:27:00Z","body":"Thanks. I'll take a look. While it's probably not highly relevant, which version of PHP are you using?"}}