Fixed delayed network detection attempting to overwrite read-only value (#854).

This commit is contained in:
Richard Moore 2020-05-29 04:03:46 -04:00
parent 180a1aff3a
commit 8efd8d2031
No known key found for this signature in database
GPG Key ID: 665176BE8E9DC651

@ -271,12 +271,15 @@ export class BaseProvider extends Provider {
}
// This should never happen; every Provider sub-class should have
// suggested a network by here (or thrown).
// suggested a network by here (or have thrown).
if (!network) {
logger.throwError("no network detected", Logger.errors.UNKNOWN_ERROR, { });
}
defineReadOnly(this, "_network", network);
// Possible this call stacked so do not call defineReadOnly again
if (this._network == null) {
defineReadOnly(this, "_network", network);
}
}
return this._network;