[WFLY-2666] Fixing NPE

https://issues.jboss.org/browse/WFLY-2666