@@ -16,7 +16,7 @@ class ExchangeContainer extends React.Component {
16
16
render ( ) {
17
17
let symbols = this . props . params . marketID . toUpperCase ( ) . split ( "_" ) ;
18
18
if ( symbols [ 0 ] === symbols [ 1 ] ) {
19
- return < Page404 /> ;
19
+ return < Page404 subtitle = "market_not_found_subtitle" /> ;
20
20
}
21
21
return (
22
22
< AltContainer
@@ -151,6 +151,9 @@ class ExchangeSubscriber extends React.Component {
151
151
}
152
152
153
153
componentWillMount ( ) {
154
+ if ( this . props . quoteAsset === null || this . props . baseAsset === null ) {
155
+ return ;
156
+ }
154
157
if ( this . props . quoteAsset . toJS && this . props . baseAsset . toJS ) {
155
158
this . _subToMarket ( this . props ) ;
156
159
// this._addMarket(this.props.quoteAsset.get("symbol"), this.props.baseAsset.get("symbol"));
@@ -203,6 +206,9 @@ class ExchangeSubscriber extends React.Component {
203
206
}
204
207
205
208
componentWillReceiveProps ( nextProps ) {
209
+ if ( nextProps . quoteAsset === null || nextProps . baseAsset === null ) {
210
+ return ;
211
+ }
206
212
/* Prediction markets should only be shown in one direction, if the link goes to the wrong one we flip it */
207
213
if (
208
214
nextProps . baseAsset &&
@@ -238,6 +244,10 @@ class ExchangeSubscriber extends React.Component {
238
244
239
245
componentWillUnmount ( ) {
240
246
let { quoteAsset, baseAsset} = this . props ;
247
+ if ( quoteAsset === null || baseAsset === null ) {
248
+ return ;
249
+ }
250
+
241
251
MarketsActions . unSubscribeMarket (
242
252
quoteAsset . get ( "id" ) ,
243
253
baseAsset . get ( "id" )
@@ -269,6 +279,9 @@ class ExchangeSubscriber extends React.Component {
269
279
}
270
280
271
281
render ( ) {
282
+ if ( this . props . quoteAsset === null || this . props . baseAsset === null )
283
+ return < Page404 subtitle = "market_not_found_subtitle" /> ;
284
+
272
285
return (
273
286
< Exchange
274
287
{ ...this . props }
0 commit comments