Protect against exception, thanks to @dreamcat4

From https://github.com/dreamcat4/UniversalMediaServer/commit/49fdbcdd59f915f53d83fcf42bfdf671d6b5e4a0