# Buggy code
def process_compressed_mdblob(self, compressed_data):
    return self.process_squashed_mdblob(lz4.frame.decompress(compressed_data))


# Traceback (RuntimeError)
ERROR   1551843034.02    LibtorrentDownloadImpl:788  (LibtorrentDownloadImpl)  Resume data failed to save: <class 'Tribler.Core.exceptions.SaveResumeDataError'>: torrent has no metadata
Unhandled error in Deferred:

ERROR   1551843034.15            tribler_window:67   (root)  Traceback (most recent call last):
File "TriblerGUI\event_request_manager.py", line 135, in on_read_data
RuntimeError: [Failure instance: Traceback: <type 'exceptions.RuntimeError'>: LZ4F_decompress failed with code: ERROR_decompressionFailed
lib\site-packages\twisted\internet\base.py:1243:run
lib\site-packages\twisted\internet\base.py:1252:mainLoop
lib\site-packages\twisted\internet\base.py:878:runUntilCurrent
lib\site-packages\twisted\internet\task.py:239:__call__
--- <exception caught here> ---
lib\site-packages\twisted\internet\defer.py:150:maybeDeferred
Tribler\Core\Libtorrent\LibtorrentMgr.py:612:_task_process_alerts
Tribler\Core\Libtorrent\LibtorrentMgr.py:408:process_alert
Tribler\Core\Libtorrent\__init__.py:17:invoke_func
Tribler\Core\Libtorrent\LibtorrentDownloadImpl.py:488:process_alert
Tribler\Core\Libtorrent\__init__.py:17:invoke_func
Tribler\Core\Libtorrent\LibtorrentDownloadImpl.py:628:on_torrent_finished_alert
Tribler\Core\Modules\gigachannel_manager.py:185:<lambda>
Tribler\Core\Modules\gigachannel_manager.py:115:on_channel_download_finished
Tribler\Core\Modules\MetadataStore\store.py:182:process_channel_dir
<auto generated wrapper of process_mdblob_file() function>:2:process_mdblob_file
lib\site-packages\pony\orm\core.py:515:new_func
Tribler\Core\Modules\MetadataStore\store.py:202:process_mdblob_file
<auto generated wrapper of process_compressed_mdblob() function>:2:process_compressed_mdblob
lib\site-packages\pony\orm\core.py:515:new_func
Tribler\Core\Modules\MetadataStore\store.py:207:process_compressed_mdblob
]

INFO    1551843034.17                 community:506  (TrustChainTestnetCommunity)  Received crawl request from node 5e00a2d9 for range 383-383
INFO    1551843034.18                 community:539  (TrustChainTestnetCommunity)  Sent 2 blocks
INFO    1551843034.31            LaunchManyCore:690  (TriblerLaunchMany)  tlm: early_shutdown
INFO    1551843034.31                   Session:543  (Session)  Tribler shutdown state notification:Shutting down Credit Mining...
INFO    1551843034.31       CreditMiningManager:105  (CreditMiningManager)  Shutting down CreditMiningManager
INFO    1551843034.31                   Session:543  (Session)  Tribler shutdown state notification:Shutting down Torrent Checker...
INFO    1551843034.34                   Session:543  (Session)  Tribler shutdown state notification:Shutting down Gigachannel Manager...
INFO    1551843034.34                   Session:543  (Session)  Tribler shutdown state notification:Shutting down Video Server...
ERROR:Executor:********** TRIBLER CRASHED **********
ERROR:Executor:Tribler crashed after uptime of 19548.2940001 sec! Stack trace: Traceback (most recent call last):
File "TriblerGUI\event_request_manager.py", line 135, in on_read_data
RuntimeError: [Failure instance: Traceback: <type 'exceptions.RuntimeError'>: LZ4F_decompress failed with code: ERROR_decompressionFailed
lib\site-packages\twisted\internet\base.py:1243:run
lib\site-packages\twisted\internet\base.py:1252:mainLoop
lib\site-packages\twisted\internet\base.py:878:runUntilCurrent
lib\site-packages\twisted\internet\task.py:239:__call__
--- <exception caught here> ---
lib\site-packages\twisted\internet\defer.py:150:maybeDeferred
Tribler\Core\Libtorrent\LibtorrentMgr.py:612:_task_process_alerts
Tribler\Core\Libtorrent\LibtorrentMgr.py:408:process_alert
Tribler\Core\Libtorrent\__init__.py:17:invoke_func
Tribler\Core\Libtorrent\LibtorrentDownloadImpl.py:488:process_alert
Tribler\Core\Libtorrent\__init__.py:17:invoke_func
Tribler\Core\Libtorrent\LibtorrentDownloadImpl.py:628:on_torrent_finished_alert
Tribler\Core\Modules\gigachannel_manager.py:185:<lambda>
Tribler\Core\Modules\gigachannel_manager.py:115:on_channel_download_finished
Tribler\Core\Modules\MetadataStore\store.py:182:process_channel_dir
<auto generated wrapper of process_mdblob_file() function>:2:process_mdblob_file
lib\site-packages\pony\orm\core.py:515:new_func
Tribler\Core\Modules\MetadataStore\store.py:202:process_mdblob_file
<auto generated wrapper of process_compressed_mdblob() function>:2:process_compressed_mdblob
lib\site-packages\pony\orm\core.py:515:new_func
Tribler\Core\Modules\MetadataStore\store.py:207:process_compressed_mdblob
]

INFO:Executor:About to shutdown Tribler

# Fixed code
def process_compressed_mdblob(self, compressed_data):
    try:
        decompressed_data = lz4.frame.decompress(compressed_data)
    except RuntimeError:
        self._logger.warning("Unable to decompress mdblob")
        return []

    return self.process_squashed_mdblob(decompressed_data)