瀏覽代碼

popi_reimbursement: don't bail on missing price

raylu 6 天之前
父節點
當前提交
9faf3c8994
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      popi_reimbursement.py

+ 1 - 1
popi_reimbursement.py

@@ -22,7 +22,7 @@ def main() -> None:
 				continue
 			print('\t' + contribution['Time'])
 			for mat in contribution['Materials']:
-				price = prices[mat['Ticker']]
+				price = prices.get(mat['Ticker'], 0)
 				print(f'\t\t{mat["Ticker"]} {mat["Amount"]} @ {price} = {mat["Amount"] * price}')
 
 def get_prices() -> typing.Mapping[str, float]: