Fix potential fatal error when fetching orders via API
Merge pull request #4601 from maxrice/master

Fix potential fatal error when fetching orders via API