Added try/catch #5427

Fix of pdf not loading on android (issue 5427)