partkeepr

fork of partkeepr
git clone https://git.e1e0.net/partkeepr.git
Log | Files | Refs | Submodules | README | LICENSE

commit eb9ad2bb818d96c1f22b04ca5150d571a86dc6c2
parent 043357ec9bbb6851a28f131a2f5f32c480172a92
Author: Felicitus <felicitus@felicitus.org>
Date:   Mon, 21 Sep 2015 17:25:11 +0200

Sanity check: Ensure that associations aren't null prior attempting to render them

Diffstat:
Msrc/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/PartsGrid.js | 8++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/PartsGrid.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/PartsGrid.js @@ -300,14 +300,18 @@ Ext.define('PartKeepr.PartsGrid', { */ storageLocationRenderer: function (val, q, rec) { - return rec.getStorageLocation().get("name"); + if (rec.getStorageLocation() !== null) { + return rec.getStorageLocation().get("name"); + } }, /** * Renders the storage location */ categoryPathRenderer: function (val, q, rec) { - return rec.getCategory().get("categoryPath"); + if (rec.getCategory() !== null) { + return rec.getCategory().get("categoryPath"); + } }, /** * Renders the storage location