From fd7ad163cfb2dc58f02a2e2fb18742c01af66010 Mon Sep 17 00:00:00 2001 From: Jonathan Rosenbaum Date: Mon, 26 Jan 2015 19:18:46 +0000 Subject: [PATCH] Adds a check for obj.sold_to. --- js/transaction.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/transaction.js b/js/transaction.js index 7de5e9a..9fcdde1 100644 --- a/js/transaction.js +++ b/js/transaction.js @@ -455,7 +455,8 @@ $(function() { var sold_to = $("[name='sold_to']").val(); if (sold_to == "no_selection") { $.post("json/transaction.php",{ not_logged_in: 1, transaction_id: $transaction_id }, function(data) { - if (data) { + var obj = $.parseJSON(data); + if (obj.sold_to) { var obj = $.parseJSON(data); $("[name='sold_to']").replaceWith("" + obj.full_name + "");