Ensure an item exists on the rpcconsole stack before adding
Ensure an item exists on the rpcconsole stack before adding

Ensures that there is an item on the rpcconsole stack before adding something to the current stack so that a segmentation fault does not occur.

Github-Pull: #10060
Rebased-From: 4df76e270caa9d828179cae1c7a8918d6f91ec21

senadmd/coinmarketwatch,BitcoinHardfork/bitcoin,ShadowMyst/creativechain-core,core-bitcoin/bitcoin,ftrader-bitcoinabc/bitcoin-abc,ftrader-bitcoinabc/bitcoin-abc,zcoinofficial/zcoin,HashUnlimited/Einsteinium-Unlimited,myriadcoin/myriadcoin,cculianu/bitcoin-abc,core-bitcoin/bitcoin,argentumproject/argentum,Bitcoin-ABC/bitcoin-abc,EntropyFactory/creativechain-core,tecnovert/particl-core,Bitcoin-ABC/bitcoin-abc,zcoinofficial/zcoin,segsignal/bitcoin,Bitcoin-ABC/bitcoin-abc,tecnovert/particl-core,particl/particl-core,particl/particl-core,xieta/mincoin,EntropyFactory/creativechain-core,BitcoinHardfork/bitcoin,psionin/smartcoin,BitcoinPOW/BitcoinPOW,ftrader-bitcoinabc/bitcoin-abc,BitcoinPOW/BitcoinPOW,daliwangi/bitcoin,goldcoin/Goldcoin-GLD,ShadowMyst/creativechain-core,UASF/bitcoin,elecoin/elecoin,psionin/smartcoin,EntropyFactory/creativechain-core,argentumproject/argentum,myriadcoin/myriadcoin,mincoin-project/mincoin,goldcoin/goldcoin,Bitcoin-ABC/bitcoin-abc,Rav3nPL/PLNcoin,myriadcoin/myriadcoin,core-bitcoin/bitcoin,plncoin/PLNcoin_Core,daliwangi/bitcoin,myriadcoin/myriadcoin,daliwangi/bitcoin,ftrader-bitcoinabc/bitcoin-abc,elecoin/elecoin,zcoinofficial/zcoin,segsignal/bitcoin,Bitcoin-ABC/bitcoin-abc,psionin/smartcoin,HashUnlimited/Einsteinium-Unlimited,tecnovert/particl-core,kallewoof/elements,tdudz/elements,goldcoin/goldcoin,UASF/bitcoin,matlongsi/micropay,elecoin/elecoin,Bitcoin-ABC/bitcoin-abc,BigBlueCeiling/augmentacoin,HashUnlimited/Einsteinium-Unlimited,BitcoinPOW/BitcoinPOW,mincoin-project/mincoin,HashUnlimited/Einsteinium-Unlimited,multicoins/marycoin,tdudz/elements,zcoinofficial/zcoin,psionin/smartcoin,mincoin-project/mincoin,senadmd/coinmarketwatch,HashUnlimited/Einsteinium-Unlimited,Bitcoin-ABC/bitcoin-abc,goldcoin/Goldcoin-GLD,segsignal/bitcoin,UASF/bitcoin,daliwangi/bitcoin,ftrader-bitcoinabc/bitcoin-abc,BigBlueCeiling/augmentacoin,myriadteam/myriadcoin,tdudz/elements,tdudz/elements,EntropyFactory/creativechain-core,kallewoof/elements,dpayne9000/Rubixz-Coin,tecnovert/particl-core,dogecoin/dogecoin,kallewoof/elements,BitcoinHardfork/bitcoin,matlongsi/micropay,elecoin/elecoin,plncoin/PLNcoin_Core,BigBlueCeiling/augmentacoin,Bitcoin-ABC/bitcoin-abc,plncoin/PLNcoin_Core,argentumproject/argentum,matlongsi/micropay,BitcoinHardfork/bitcoin,ftrader-bitcoinabc/bitcoin-abc,BigBlueCeiling/augmentacoin,tecnovert/particl-core,multicoins/marycoin,zcoinofficial/zcoin,goldcoin/Goldcoin-GLD,xieta/mincoin,Bitcoin-ABC/bitcoin-abc,argentumproject/argentum,btc1/bitcoin,elecoin/elecoin,cculianu/bitcoin-abc,particl/particl-core,BitcoinHardfork/bitcoin,matlongsi/micropay,BitcoinHardfork/bitcoin,particl/particl-core,cculianu/bitcoin-abc,myriadcoin/myriadcoin,core-bitcoin/bitcoin,multicoins/marycoin,ShadowMyst/creativechain-core,Rav3nPL/PLNcoin,mincoin-project/mincoin,xieta/mincoin,dogecoin/dogecoin,dpayne9000/Rubixz-Coin,particl/particl-core,EntropyFactory/creativechain-core,BitcoinPOW/BitcoinPOW,elecoin/elecoin,Rav3nPL/PLNcoin,matlongsi/micropay,plncoin/PLNcoin_Core,Bitcoin-ABC/bitcoin-abc,ShadowMyst/creativechain-core,goldcoin/goldcoin,dpayne9000/Rubixz-Coin,kallewoof/elements,Rav3nPL/PLNcoin,ftrader-bitcoinabc/bitcoin-abc,xieta/mincoin,ftrader-bitcoinabc/bitcoin-abc,ShadowMyst/creativechain-core,zcoinofficial/zcoin,patricklodder/dogecoin,matlongsi/micropay,myriadteam/myriadcoin,senadmd/coinmarketwatch,segsignal/bitcoin,Bitcoin-ABC/bitcoin-abc,BigBlueCeiling/augmentacoin,plncoin/PLNcoin_Core,daliwangi/bitcoin,patricklodder/dogecoin,BigBlueCeiling/augmentacoin,myriadteam/myriadcoin,dogecoin/dogecoin,tdudz/elements,goldcoin/goldcoin,Bitcoin-ABC/bitcoin-abc,dogecoin/dogecoin,patricklodder/dogecoin,segsignal/bitcoin,argentumproject/argentum,multicoins/marycoin,cculianu/bitcoin-abc,multicoins/marycoin,dogecoin/dogecoin,kallewoof/elements,btc1/bitcoin,dpayne9000/Rubixz-Coin,goldcoin/Goldcoin-GLD,xieta/mincoin,cculianu/bitcoin-abc,plncoin/PLNcoin_Core,multicoins/marycoin,tecnovert/particl-core,zcoinofficial/zcoin,daliwangi/bitcoin,goldcoin/Goldcoin-GLD,Rav3nPL/PLNcoin,UASF/bitcoin,ftrader-bitcoinabc/bitcoin-abc,cculianu/bitcoin-abc,BitcoinPOW/BitcoinPOW,mincoin-project/mincoin,kallewoof/elements,btc1/bitcoin,particl/particl-core,argentumproject/argentum,senadmd/coinmarketwatch,btc1/bitcoin,zcoinofficial/zcoin,myriadteam/myriadcoin,zcoinofficial/zcoin,myriadteam/myriadcoin,myriadcoin/myriadcoin,tdudz/elements,dpayne9000/Rubixz-Coin,patricklodder/dogecoin,ftrader-bitcoinabc/bitcoin-abc,psionin/smartcoin,segsignal/bitcoin,argentumproject/argentum,btc1/bitcoin,goldcoin/goldcoin,myriadteam/myriadcoin,UASF/bitcoin,zcoinofficial/zcoin,ShadowMyst/creativechain-core,psionin/smartcoin,btc1/bitcoin,HashUnlimited/Einsteinium-Unlimited,Rav3nPL/PLNcoin,mincoin-project/mincoin,xieta/mincoin,core-bitcoin/bitcoin,dpayne9000/Rubixz-Coin,patricklodder/dogecoin,goldcoin/Goldcoin-GLD,dogecoin/dogecoin,cculianu/bitcoin-abc,UASF/bitcoin,BitcoinPOW/BitcoinPOW,core-bitcoin/bitcoin,Bitcoin-ABC/bitcoin-abc,goldcoin/goldcoin,cculianu/bitcoin-abc,senadmd/coinmarketwatch,EntropyFactory/creativechain-core,senadmd/coinmarketwatch