Checking of segue type.

It would be need if we will use complex hierarchy of controllers and use other Cocoapods. Also this code can prevent a crash.