Merge lp:~dobey/ubuntuone-client/hash-crash-fix into lp:ubuntuone-client

Proposed by dobey
Status: Merged
Approved by: John O'Brien
Approved revision: 66
Merged at revision: not available
Proposed branch: lp:~dobey/ubuntuone-client/hash-crash-fix
Merge into: lp:ubuntuone-client
Diff against target: None lines
To merge this branch: bzr merge lp:~dobey/ubuntuone-client/hash-crash-fix
Reviewer Review Type Date Requested Status
John O'Brien (community) Approve
Elliot Murphy (community) Approve
Review via email: mp+8275@code.launchpad.net

Commit message

[r=statik, r=jdobrien] Fix the code to handle NULL from g_filename_from_uri

To post a comment you must log in.
Revision history for this message
Elliot Murphy (statik) wrote :

i like it.

review: Approve
Revision history for this message
John O'Brien (jdobrien) wrote :

Looks good

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'nautilus/ubuntuone-nautilus.c'
2--- nautilus/ubuntuone-nautilus.c 2009-07-02 17:29:23 +0000
3+++ nautilus/ubuntuone-nautilus.c 2009-07-06 17:19:38 +0000
4@@ -149,14 +149,18 @@
5
6 path = g_filename_from_uri (nautilus_file_info_get_uri (file), NULL, NULL);
7
8- if (g_hash_table_lookup (uon->uploads, path))
9- nautilus_file_info_add_emblem (file, "ubuntuone-uploading");
10-
11- if (g_hash_table_lookup (uon->downloads, path))
12- nautilus_file_info_add_emblem (file, "ubuntuone-downloading");
13-
14- if (g_hash_table_lookup (uon->shares, path))
15- nautilus_file_info_add_emblem (file, "shared");
16+ if (path) {
17+ if (g_hash_table_lookup (uon->uploads, path))
18+ nautilus_file_info_add_emblem (file, "ubuntuone-uploading");
19+
20+ if (g_hash_table_lookup (uon->downloads, path))
21+ nautilus_file_info_add_emblem (file, "ubuntuone-downloading");
22+
23+ if (g_hash_table_lookup (uon->shares, path))
24+ nautilus_file_info_add_emblem (file, "shared");
25+
26+ g_free (path);
27+ }
28
29 return NAUTILUS_OPERATION_COMPLETE;
30 }
31@@ -208,7 +212,7 @@
32
33 path = g_filename_from_uri (uri, NULL, NULL);
34
35- if (!ubuntuone_is_storagefs (uon, path))
36+ if (!path || !ubuntuone_is_storagefs (uon, path))
37 goto location_done;
38
39 hbox = gtk_hbox_new (FALSE, 6);
40@@ -413,7 +417,7 @@
41 shared = g_build_filename (uon->managed, "Shared with Me", NULL);
42 myfiles = g_build_filename (uon->managed, "My Files", NULL);
43
44- if (!ubuntuone_is_storagefs (uon, path))
45+ if (!path || !ubuntuone_is_storagefs (uon, path))
46 goto done;
47
48 if (strncmp (path, shared, strlen (shared)) == 0)

Subscribers

People subscribed via source and target branches