Why does fasting irritates ulcer when acid secretion is only triggered by ingesting food?

I have always thought once the food is eaten, to break it down and to sterelize it the stomach secretes hydrochloric acid.

Gastrin is a hormone that is produced by 'G' cells in the lining of the stomach and upper small intestine, and released into the blood circulation. During a meal, gastrin stimulates the stomach to release gastric acid (hydrochloric acid). Source.)

But I have recently learnt that fasting can increase acid levels in stomach as it's not spentfood when empty which increases the chances of bleeding and flareups if someone already has ulcer.

“When there are no contents or food in the stomach for it to break down, such as when one is fasting, stomach acid levels can start to increase,” says Dr. Berookim Source

This is contradicting information. What exactly is happening? I know from personal experience fasting does indeed cause irritation and flareups of ulcers. So what exactly is causing it if only ingestion of food can stimulate acid secretion?

/r/AskReddit Thread