BUG:  Need to check the dynamic cast before any calls.

Change-Id: I9db700cfc276d7393d589e9d8db0178ac3e99e0f
Merge topic 'RegScanDefects'

218bb59c BUG:  Need to check the dynamic cast before any calls.