Permalink
Browse files

Fix conditional.

  • Loading branch information...
1 parent f0a5dec commit 82f003c9a3674482239daf7e00240a2b44ea1e87 @dlongley dlongley committed Apr 21, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 js/jsonld.js
View
@@ -791,13 +791,13 @@ jsonld.compareNormalized = function(n1, n2) {
* @return the value.
*/
jsonld.getContextValue = function(ctx, key, type) {
+ var rval = null;
+
// return null for invalid key
if(key === null) {
- return null;
+ return rval;
}
- var rval = null;
-
// get default language
if(type === '@language' && (type in ctx)) {
rval = ctx[type];
@@ -812,7 +812,7 @@ jsonld.getContextValue = function(ctx, key, type) {
rval = entry;
}
// return entry value for type
- if(type in entry) {
+ else if(type in entry) {
rval = entry[type];
}
}

0 comments on commit 82f003c

Please sign in to comment.