Exception in bridge during onClose because of logging

Hi ,
i had an issue in the Bridge which i fixed with this patch, but i think it must come from somewhere else i could not exatly reproduce it, except for having a js even making a window.close on a window having an opened websocket connection. since the call to getId in line 96 caused my exception (calling getId on null) i think this is a solution but should be better tracked down if connection is expected to be an object after closing it...