return failure message for invalid blob hash in blob_delete

This commit is contained in:
Jack Robison 2019-02-18 12:14:21 -05:00
parent 4483380352
commit 3f7e466c97
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2

View file

@ -2588,7 +2588,8 @@ class Daemon(metaclass=JSONRPCServerType):
Returns: Returns:
(str) Success/fail message (str) Success/fail message
""" """
if not blob_hash or not is_valid_blobhash(blob_hash):
return f"Invalid blob hash to delete '{blob_hash}'"
streams = self.stream_manager.get_filtered_streams(sd_hash=blob_hash) streams = self.stream_manager.get_filtered_streams(sd_hash=blob_hash)
if streams: if streams:
await self.stream_manager.delete_stream(streams[0]) await self.stream_manager.delete_stream(streams[0])