mirror of
https://github.com/appium/appium.git
synced 2026-02-09 11:18:51 -06:00
Merge pull request #2619 from bootstraponline/read_file_fix
Check exists before read file
This commit is contained in:
@@ -375,8 +375,11 @@ androidController.getPageSource = function (cb) {
|
||||
// Top level cb
|
||||
function (err) {
|
||||
if (err) return cb(err);
|
||||
var xml = fs.readFileSync(xmlFile, 'utf8');
|
||||
fs.unlinkSync(xmlFile);
|
||||
var xml = '';
|
||||
if (fs.existsSync(xmlFile)) {
|
||||
xml = fs.readFileSync(xmlFile, 'utf8');
|
||||
fs.unlinkSync(xmlFile);
|
||||
}
|
||||
try {
|
||||
xml = _updateSourceXMLNodeNames(xml);
|
||||
} catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user