Fix a crash if a client requests an order book snapshot before we have a published ledger.

This commit is contained in:
JoelKatz
2013-09-29 11:34:07 -07:00
parent 511978b1eb
commit 191e76a558

View File

@@ -3492,6 +3492,8 @@ Json::Value RPCHandler::doSubscribe (Json::Value params, LoadType* loadType, App
if (bSnapshot)
{
Ledger::pointer lpLedger = getApp().getLedgerMaster ().getPublishedLedger ();
if (lpLedger)
{
const Json::Value jvMarker = Json::Value (Json::nullValue);
if (bBoth)
@@ -3514,6 +3516,7 @@ Json::Value RPCHandler::doSubscribe (Json::Value params, LoadType* loadType, App
}
}
}
}
return jvResult;
}