A general rule of thumb is to position your tent heater properly, keeping it 3 feet away from anything that can burn. Even though electric heaters are known to be the safest option, if flammable material comes into contact with its heating elements, it can still cause a fire hazard. Remember to keep all liquids away from the heater. It only takes one kick of your foot for your drink to spill onto the heater and cause problems.
Gas heaters on the other hand create carbon dioxide and carbon monoxide. If it reaches a toxic level, it prevents absorption of oxygen to your bloodstream. Do read the instructions on the gas heater provided by the manufacturer on how much ventilation is needed for safe use.
There should be a vent opened for toxic gases to exit the tent, allowing fresh air to enter. It is not a wise idea to leave the gas heater running , while you sleep. The risk is you may fail to wake up if something goes wrong, endangering others around you.