Fix for AMQ-4857, added test for null before accessing protocol string