Skip to content

Commit

Permalink
check for label
Browse files Browse the repository at this point in the history
  • Loading branch information
edsilv committed Aug 22, 2018
1 parent c62aba9 commit 8712d9f
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion dist/client/manifesto.bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -3273,7 +3273,7 @@ var Manifesto;
if (this.value) {
var locale = this.defaultLocale;
// if the label has a locale, prefer that to the default locale
if (this.label.length && this.label[0].locale) {
if (this.label && this.label.length && this.label[0].locale) {
locale = this.label[0].locale;
}
return Manifesto.LanguageMap.getValue(this.value, locale);
Expand Down
4 changes: 2 additions & 2 deletions dist/client/manifesto.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// manifesto v3.0.2 https://github.com/iiif-commons/manifesto
// manifesto v3.0.3 https://github.com/iiif-commons/manifesto
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.manifesto = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
(function (global){

Expand Down Expand Up @@ -3201,7 +3201,7 @@ var Manifesto;
if (this.value) {
var locale = this.defaultLocale;
// if the label has a locale, prefer that to the default locale
if (this.label.length && this.label[0].locale) {
if (this.label && this.label.length && this.label[0].locale) {
locale = this.label[0].locale;
}
return Manifesto.LanguageMap.getValue(this.value, locale);
Expand Down
2 changes: 1 addition & 1 deletion dist/manifesto.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// manifesto v3.0.2 https://github.com/iiif-commons/manifesto
// manifesto v3.0.3 https://github.com/iiif-commons/manifesto

declare namespace Manifesto {
class StringValue {
Expand Down
4 changes: 2 additions & 2 deletions dist/server/manifesto.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "manifesto.js",
"version": "3.0.2",
"version": "3.0.3",
"description": "IIIF Presentation API utility library for client and server",
"main": "./dist/server/manifesto.js",
"types": "./dist/manifesto.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion src/LabelValuePair.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ namespace Manifesto {
var locale: string = this.defaultLocale;

// if the label has a locale, prefer that to the default locale
if (this.label.length && this.label[0].locale) {
if (this.label && this.label.length && this.label[0].locale) {
locale = this.label[0].locale;
}

Expand Down

0 comments on commit 8712d9f

Please sign in to comment.