server: default_set_sd is used during object creation, however the "current" thread might be unset in some cases, check if a current thread exists before using it.
Note: this issue does not trigger at the moment because creating an object with a NULL sd does not call this method (see next commit)