Commit dcf377676e63207a9e8d4636f95a6c7a7b1f0661
fixes https://github.com/ssbc/patchwork/issues/563
``` TypeError: Cannot read property 'link' of null at compareImage (/home/dinosaur/repos/ssbc/patchwork/modules/gathering/sheet/edit.js:159:32) at HTMLButtonElement.save (/home/dinosaur/repos/ssbc/patchwork/modules/gathering/sheet/edit.js:112:14) ```Michael Williams committed on 6/19/2017, 9:53:52 AM
Parent: 7d0bb2a423493cd547b8262bd6ac410900ff37c6
Files changed
modules/gathering/sheet/edit.js | changed |
modules/gathering/sheet/edit.js | ||
---|---|---|
@@ -154,13 +154,17 @@ | ||
154 | 154 … | } |
155 | 155 … | } |
156 | 156 … | |
157 | 157 … | function compareImage (a, b) { |
158 | - a = typeof a === 'object' ? a.link : a | |
159 | - b = typeof b === 'object' ? b.link : b | |
158 … | + a = isObject(a) ? a.link : a | |
159 … | + b = isObject(b) ? b.link : b | |
160 | 160 … | return a === b |
161 | 161 … | } |
162 | 162 … | |
163 … | +function isObject (value) { | |
164 … | + return value && typeof value === 'object' | |
165 … | +} | |
166 … | + | |
163 | 167 … | function FocusHook () { |
164 | 168 … | return function (element) { |
165 | 169 … | setTimeout(() => { |
166 | 170 … | element.focus() |
Built with git-ssb-web