{"action":"closed","issue":{"url":"https://api.github.com/repos/makinacorpus/angular2-schema-form/issues/188","repository_url":"https://api.github.com/repos/makinacorpus/angular2-schema-form","labels_url":"https://api.github.com/repos/makinacorpus/angular2-schema-form/issues/188/labels{/name}","comments_url":"https://api.github.com/repos/makinacorpus/angular2-schema-form/issues/188/comments","events_url":"https://api.github.com/repos/makinacorpus/angular2-schema-form/issues/188/events","html_url":"https://github.com/makinacorpus/angular2-schema-form/issues/188","id":294622431,"number":188,"title":"Error when Json schema with default value as NULL","user":{"login":"roshan-lanewala","id":25914507,"avatar_url":"https://avatars1.githubusercontent.com/u/25914507?v=4","gravatar_id":"","url":"https://api.github.com/users/roshan-lanewala","html_url":"https://github.com/roshan-lanewala","followers_url":"https://api.github.com/users/roshan-lanewala/followers","following_url":"https://api.github.com/users/roshan-lanewala/following{/other_user}","gists_url":"https://api.github.com/users/roshan-lanewala/gists{/gist_id}","starred_url":"https://api.github.com/users/roshan-lanewala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roshan-lanewala/subscriptions","organizations_url":"https://api.github.com/users/roshan-lanewala/orgs","repos_url":"https://api.github.com/users/roshan-lanewala/repos","events_url":"https://api.github.com/users/roshan-lanewala/events{/privacy}","received_events_url":"https://api.github.com/users/roshan-lanewala/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-06T03:42:46Z","updated_at":"2018-02-06T03:55:06Z","closed_at":"2018-02-06T03:55:06Z","author_association":"NONE","body":"ENV:\r\n\r\n> @ angular/cli :  1.3.2\r\n> node : 8.9.4\r\n> os : win32 x64\r\n> @ angular/animations : 5.2.3\r\n> @ angular/cdk : 2.0.0-beta.12\r\n> @ angular/common : 5.2.3\r\n> @ angular/compiler : 5.2.3\r\n> @ angular/core : 5.2.3\r\n> @ angular/flex-layout : 2.0.0-beta.12\r\n> @ angular/forms : 5.2.3\r\n> @ angular/http : 5.2.3\r\n> @ angular/material : 2.0.0-beta.12\r\n> @ angular/platform-browser : 5.2.3\r\n> @ angular/platform-browser-dynamic : 5.2.3\r\n> @ angular/router : 5.2.3\r\n> @ angular/cli : 1.3.2\r\n> @ angular/compiler-cli : 5.2.3\r\n> @ angular/language-service : 4.4.6\r\n\r\nschema:\r\n{\r\n  \"type\": \"object\",\r\n  \"title\": \"Comment\",\r\n  \"properties\": {\r\n    \"name\": {\r\n      \"title\": \"Name\",\r\n      \"type\": \"string\"\r\n    },\r\n    \"declare\": {\r\n      \"title\": \"I am the person in charge of the cattle during the movement and declare all the information in Part B is true and correct.\",\r\n      \"type\": [\r\n        \"boolean\",\r\n        \"null\"\r\n      ],\r\n      \"default\": null\r\n    }\r\n  },\r\n  \"required\": [\r\n    \"name\"\r\n  ]\r\n}\r\n\r\n\r\nAngular2 schema form fails and throws : \"ERROR TypeError: Cannot read property '$ref' of null\"\r\nstack trace:\r\nConsignmentDetailsComponent.html:29 ERROR TypeError: Cannot read property '$ref' of null\r\n    at angular2-json-schema-form.es5.js:5599\r\n    at Function.webpackJsonp.../../../../angular2-json-schema-form/angular2-json-schema-form.es5.js.JsonPointer.forEachDeep (angular2-json-schema-form.es5.js:2555)\r\n    at Function.webpackJsonp.../../../../angular2-json-schema-form/angular2-json-schema-form.es5.js.JsonPointer.forEachDeep (angular2-json-schema-form.es5.js:2551)\r\n    at Function.webpackJsonp.../../../../angular2-json-schema-form/angular2-json-schema-form.es5.js.JsonPointer.forEachDeep (angular2-json-schema-form.es5.js:2551)\r\n    at Function.webpackJsonp.../../../../angular2-json-schema-form/angular2-json-schema-form.es5.js.JsonPointer.forEachDeep (angular2-json-schema-form.es5.js:2551)\r\n    at Function.webpackJsonp.../../../../angular2-json-schema-form/angular2-json-schema-form.es5.js.JsonPointer.forEachDeep (angular2-json-schema-form.es5.js:2551)\r\n    at Function.webpackJsonp.../../../../angular2-json-schema-form/angular2-json-schema-form.es5.js.JsonPointer.forEachDeep (angular2-json-schema-form.es5.js:2551)\r\n    at Function.webpackJsonp.../../../../angular2-json-schema-form/angular2-json-schema-form.es5.js.JsonPointer.forEachDeep (angular2-json-schema-form.es5.js:2551)\r\n    at Function.webpackJsonp.../../../../angular2-json-schema-form/angular2-json-schema-form.es5.js.JsonPointer.forEachDeep (angular2-json-schema-form.es5.js:2551)\r\n    at Function.webpackJsonp.../../../../angular2-json-schema-form/angular2-json-schema-form.es5.js.JsonPointer.forEachDeep (angular2-json-schema-form.es5.js:2551)\r\n\r\njson schema:\r\n{\r\n\"declare\": {\r\n      \"title\": \"I agree.\",\r\n      \"type\": [\r\n        \"boolean\",\r\n        \"null\"\r\n      ],\r\n      \"default\": null\r\n    }\r\n}\r\n\r\nfor subSchemaPointer - \"declare/default\" the subSchema value is NULL and when trying to do isString(subSchema['$ref']) on line # 5597 errors.\r\n\r\nhow should I fix it?\r\n\r\n"}}
{"actor":{"display_login":"roshan-lanewala"}}