From e4a6b6f81fa492a63b12f0da0c381612deff1973 Mon Sep 17 00:00:00 2001 From: dcodeIO Date: Mon, 27 Mar 2017 17:15:25 +0200 Subject: [PATCH] Other: Make sure that util.Long is overridden by AMD loaders only if present, see #730 --- lib/prelude.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/prelude.js b/lib/prelude.js index ee30929ac..e1743fa5d 100644 --- a/lib/prelude.js +++ b/lib/prelude.js @@ -18,8 +18,10 @@ // Be nice to AMD if (typeof define === "function" && define.amd) define(["long"], function(Long) { - protobuf.util.Long = Long; - protobuf.configure(); + if (Long && Long.fromValue) { + protobuf.util.Long = Long; + protobuf.configure(); + } return protobuf; });