Fixed delayed network detection attempting to overwrite read-only value (#854).
This commit is contained in:
parent
180a1aff3a
commit
8efd8d2031
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user