Error out if key is missing

This commit is contained in:
Hector Martin 2017-07-29 19:41:52 +09:00
parent 20e887db90
commit 4d79df1ca7

View File

@ -1501,6 +1501,8 @@ class WiiWadMaker(WiiWad):
self.data_off = self.f.tell() self.data_off = self.f.tell()
def adddata(self, data, cid): def adddata(self, data, cid):
if self.tik.title_key is None:
raise Exception("Required key is not available")
i = self.tmd.find_cr_by_cid(cid) i = self.tmd.find_cr_by_cid(cid)
cr = self.tmd.get_content_records()[i] cr = self.tmd.get_content_records()[i]
cr.sha = SHA.new(data).digest() cr.sha = SHA.new(data).digest()