Fix #2231. Prevent UH from crashing when it looses

network connection.