Skip to content
Snippets Groups Projects
Commit 7c2595f1 authored by dan mcweeney's avatar dan mcweeney Committed by GitHub Enterprise
Browse files

Merge pull request #12 from mcweeney/master

Fixes NPE when datatype doesn't have property
parents 2f750a19 b82e873f
No related branches found
No related tags found
No related merge requests found
...@@ -23,3 +23,5 @@ npm-debug.log ...@@ -23,3 +23,5 @@ npm-debug.log
# mac files # mac files
.DS_Store .DS_Store
.tool-versions
...@@ -21,7 +21,10 @@ layout: default ...@@ -21,7 +21,10 @@ layout: default
--- ---
<% <%
function escape(s) { function escape(s) {
return s.replace(/\r\n/g, '<br>').replace(/\n/g, '<br>'); if (s) {
return s.replace(/\r\n/g, '<br>').replace(/\n/g, '<br>');
}
return "";
} }
%> %>
# <%- clazz[consts.RDFS_LABEL] %> # <%- clazz[consts.RDFS_LABEL] %>
...@@ -31,4 +34,5 @@ function escape(s) { ...@@ -31,4 +34,5 @@ function escape(s) {
Note: <%- clazz[consts.SKOS_NOTE] %><% } %> Note: <%- clazz[consts.SKOS_NOTE] %><% } %>
|Name|JSON Name|Type|Description|Immutable|Mandatory|UserEditable|Note|Example Value| |Name|JSON Name|Type|Description|Immutable|Mandatory|UserEditable|Note|Example Value|
|--- |--- |--- |--- |--- |--- |--- |--- |--- |<% _.forEach(clazz.properties, function (prop) { %> |--- |--- |--- |--- |--- |--- |--- |--- |--- |<% _.forEach(clazz.properties, function (prop) { %>
| <%- prefixes.shrink(prop["@id"]) %> | <%- prop[consts.META_JSONNAME] %> | <%- model.datatypes[prop[consts.RDFS_RANGE]][consts.RDFS_LABEL] %> | <%- escape(prop[consts.RDFS_COMMENT]) %> | <%- escape(prop[consts.PROP_IMMUTABLE]) %> | <%- escape(prop[consts.PROP_MANDATORY]) %> | <%- escape(prop[consts.PROP_USEREDITABLE]) %> | <%- escape(prop[consts.SKOS_NOTE]) %> | <%- escape(prop[consts.SKOS_EXAMPLE]) %> | <% }); %> | <%- prefixes.shrink(prop["@id"]) %> | <%- prop[consts.META_JSONNAME] %> | <%- model.datatypes[prop[consts.RDFS_RANGE]][consts.RDFS_LABEL] %> | <%- escape(prop[consts.RDFS_COMMENT]) %> | <%- escape(prop[consts.PROP_IMMUTABLE]) %> | <%- escape(prop[consts.PROP_MANDATORY]) %> | <%- escape(prop[consts.PROP_USEREDITABLE]) %> | <%- escape(prop[consts.SKOS_NOTE]) %> | <%- escape(prop[consts.SKOS_EXAMPLE]) %> |
<% }); %>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment