Bug 488063 - TypeError: Cannot read property 'DiffLocation' of undefined (in gitCommands.js)
Summary: TypeError: Cannot read property 'DiffLocation' of undefined (in gitCommands.js)
Status: NEW
Alias: None
Product: Orion (Archived)
Classification: ECD
Component: Git (show other bugs)
Version: 10.0   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Grant Gayed CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2016-02-18 16:34 EST by Grant Gayed CLA
Modified: 2017-01-06 15:30 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Grant Gayed CLA 2016-02-18 16:34:24 EST
An error was logged for two Chrome users recently at the line marked below (data.items.Diffs.Children[0] can be undefined):

var showPatchCallback = function(data) {
	var items = forceArray(data.items);
	if (items.length === 0) {
		var display = {};
		display.Severity = "Warning"; //$NON-NLS-0$
		display.HTML = false;
		display.Message = messages.EmptyPatchWarning;
		serviceRegistry.getService("orion.page.message").setProgressResult(display); //$NON-NLS-0$
		return null;
	}
	var url, i;
	if (data.userData && data.userData.Clone && data.userData.Clone.DiffLocation) {
		url = data.userData.Clone.DiffLocation.replace("\/Default\/", "\/Cached\/") + "?parts=diff"; //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$
		for (i = 0; i < items.length; i++) {
			url += "&Path="; //$NON-NLS-0$
			url += items[i].name;
		}
	} else if (data.items && data.items.Diffs && data.items.Diffs.Children) {
		var baseLocation = data.items.Diffs.Children[0].DiffLocation; // <-----