{"action":"created","issue":{"url":"https://api.github.com/repos/woothemes/woocommerce/issues/9923","labels_url":"https://api.github.com/repos/woothemes/woocommerce/issues/9923/labels{/name}","comments_url":"https://api.github.com/repos/woothemes/woocommerce/issues/9923/comments","events_url":"https://api.github.com/repos/woothemes/woocommerce/issues/9923/events","html_url":"https://github.com/woothemes/woocommerce/issues/9923","id":124450179,"number":9923,"title":"Fatal error on order factory","user":{"login":"moise","id":842453,"avatar_url":"https://avatars.githubusercontent.com/u/842453?v=3","gravatar_id":"","url":"https://api.github.com/users/moise","html_url":"https://github.com/moise","followers_url":"https://api.github.com/users/moise/followers","following_url":"https://api.github.com/users/moise/following{/other_user}","gists_url":"https://api.github.com/users/moise/gists{/gist_id}","starred_url":"https://api.github.com/users/moise/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moise/subscriptions","organizations_url":"https://api.github.com/users/moise/orgs","repos_url":"https://api.github.com/users/moise/repos","events_url":"https://api.github.com/users/moise/events{/privacy}","received_events_url":"https://api.github.com/users/moise/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-12-31T09:18:13Z","updated_at":"2016-01-04T10:38:54Z","closed_at":null,"body":"I had this error:\r\nFatal error: Call to a member function get_order() on null\r\n\r\nThe function used is wc_create_order() but the error is made by\r\n\r\nfunction wc_get_order( $the_order = false ) {\r\n\treturn WC()->order_factory->get_order( $the_order );\r\n}\r\n\r\nEdit:\r\nthe same error here:\r\nfunction wc_get_product( $the_product = false, $args = array() ) {\r\n\treturn WC()->product_factory->get_product( $the_product, $args );\r\n}\r\n\r\n\r\nany idea?"},"comment":{"url":"https://api.github.com/repos/woothemes/woocommerce/issues/comments/168641403","html_url":"https://github.com/woothemes/woocommerce/issues/9923#issuecomment-168641403","issue_url":"https://api.github.com/repos/woothemes/woocommerce/issues/9923","id":168641403,"user":{"login":"mikejolley","id":90977,"avatar_url":"https://avatars.githubusercontent.com/u/90977?v=3","gravatar_id":"","url":"https://api.github.com/users/mikejolley","html_url":"https://github.com/mikejolley","followers_url":"https://api.github.com/users/mikejolley/followers","following_url":"https://api.github.com/users/mikejolley/following{/other_user}","gists_url":"https://api.github.com/users/mikejolley/gists{/gist_id}","starred_url":"https://api.github.com/users/mikejolley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikejolley/subscriptions","organizations_url":"https://api.github.com/users/mikejolley/orgs","repos_url":"https://api.github.com/users/mikejolley/repos","events_url":"https://api.github.com/users/mikejolley/events{/privacy}","received_events_url":"https://api.github.com/users/mikejolley/received_events","type":"User","site_admin":false},"created_at":"2016-01-04T10:38:53Z","updated_at":"2016-01-04T10:38:53Z","body":"Nevermind, this will also happen if you call it before 'init'. I will add error handling, but its your code's fault :p"}}