Merge lp:~paulliu/unity-scope-click/fix-error into lp:unity-scope-click

Proposed by Ying-Chun Liu
Status: Merged
Approved by: Roberto Alsina
Approved revision: 74
Merged at revision: 79
Proposed branch: lp:~paulliu/unity-scope-click/fix-error
Merge into: lp:unity-scope-click
Diff against target: 19 lines (+7/-1)
1 file modified
src/click-scope.vala (+7/-1)
To merge this branch: bzr merge lp:~paulliu/unity-scope-click/fix-error
Reviewer Review Type Date Requested Status
Alejandro J. Cura (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+191402@code.launchpad.net

Commit message

Fix GVariant critical errors. (LP: 1234833)

Description of the change

Due to price=null causes the GLib critical errors, we fix it by not hint the price if it is null.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
74. By Ying-Chun Liu

warning if id or title is null

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alejandro J. Cura (alecu) 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 'src/click-scope.vala'
2--- src/click-scope.vala 2013-10-14 16:14:33 +0000
3+++ src/click-scope.vala 2013-10-16 13:44:41 +0000
4@@ -352,9 +352,15 @@
5 var dnd_uri = uri;
6 var mimetype = "application/x-desktop";
7 var metadata = new HashTable<string, Variant> (str_hash, str_equal);
8+ if (app.app_id == null || app.title == null) {
9+ warning ("app.app_id or app.title is null");
10+ return;
11+ }
12 metadata.insert(METADATA_APP_ID, new GLib.Variant.string(app.app_id));
13 metadata.insert(METADATA_TITLE, new GLib.Variant.string(app.title));
14- metadata.insert(METADATA_PRICE, new GLib.Variant.string(app.price));
15+ if (app.price != null) {
16+ metadata.insert(METADATA_PRICE, new GLib.Variant.string(app.price));
17+ }
18
19 var result = Unity.ScopeResult.create(uri, app.icon_url, category, Unity.ResultType.DEFAULT, mimetype, app.title, comment, dnd_uri, metadata);
20

Subscribers

People subscribed via source and target branches

to all changes: