Fix for IllegalArgumentException on ConnectionHelper

User-reported on version 1.2.3, seems really rare (only reported once). Better safe than sorry, though.