From c209428d36939102740329675c1e78f3c502c4b0 Mon Sep 17 00:00:00 2001 From: Andrzej Przedecki Date: Wed, 10 May 2017 15:07:39 +0200 Subject: [PATCH] Secured undefined path for existing refBuilders. For any usage of refBuilder, ref.parent is undefined. This causes the method to break and not index records at all. --- lib/fbutil.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/fbutil.js b/lib/fbutil.js index 393730f..e31fecd 100644 --- a/lib/fbutil.js +++ b/lib/fbutil.js @@ -16,6 +16,7 @@ exports.fbRef = function(path) { }; exports.pathName = function(ref) { + if(typeof ref.parent === 'undefined') return ref.path; var p = ref.parent.key; return (p? p+'/' : '')+ref.key; };