Use cast<> instead which will assert if it fails and not just return null. Fixes clang static analyzer warning.