Skip to content

Commit 1be0491

Browse files
committed
add guard against empty schemas
1 parent 8257588 commit 1be0491

File tree

5 files changed

+10
-4
lines changed

5 files changed

+10
-4
lines changed

dist/bundle.js

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/bundle.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/style.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*!
22
* json-schema-view-js
33
* https://github.com/mohsen1/json-schema-view-js#readme
4-
* Version: 0.4.1 - 2016-05-06T19:52:05.306Z
4+
* Version: 0.4.1 - 2016-05-06T21:04:10.062Z
55
* License: MIT
66
*/
77

dist/style.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ export default class JSONSchemaView {
3030
this.options = options;
3131
this.isCollapsed = open <= 0;
3232

33+
// Guard against empty schemas
34+
if (!this.schema) return '';
35+
3336
// if schema is an empty object which means any JOSN
3437
this.isAny = typeof schema === 'object' &&
3538
!Array.isArray(schema) &&

0 commit comments

Comments
 (0)