Catch exception

command.getElement() may return null. Appium must catch exception or it'll c
with a NullPointerException.

Fix #1140