Catch exception

command.getElement() may return null. Appium must catch exception or it'll crash
with a NullPointerException.

Fix #1140