fix NullPointerException when trying to select invalid tab position

Self explanatory, the library should not make the application crash even if application select an invalid tab position