Code is working fine but showing run error on submission

my code is showing run error https://ide.codingblocks.com/s/596812

you have not consider the case when stack is empty and query of type 1 comes

Modified code