From 08d4a5b62532f867d3af67d8b8ad72921d02412a Mon Sep 17 00:00:00 2001
From: Florian Dold <florian.dold@gmail.com>
Date: Mon, 13 Feb 2017 00:44:44 +0100
Subject: implement new protocol / naming

---
 src/renderHtml.tsx | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

(limited to 'src/renderHtml.tsx')

diff --git a/src/renderHtml.tsx b/src/renderHtml.tsx
index 40b48094e..79e101b17 100644
--- a/src/renderHtml.tsx
+++ b/src/renderHtml.tsx
@@ -30,7 +30,12 @@ export function prettyAmount(amount: AmountJson) {
 }
 
 export function renderContract(contract: Contract): JSX.Element {
-  let merchantName = <strong>{contract.merchant.name}</strong>;
+  let merchantName;
+  if (contract.merchant && contract.merchant.name) {
+    merchantName = <strong>{contract.merchant.name}</strong>;
+  } else {
+    merchantName = <strong>(pub: {contract.merchant_pub})</strong>;
+  }
   let amount = <strong>{prettyAmount(contract.amount)}</strong>;
 
   return (
-- 
cgit v1.2.3

