From 38776a01e45d425e4b3829b35e86a761dcbbcbed Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sat, 11 Jul 2015 00:10:13 -0700 Subject: [PATCH] Only create an app if an app ID was found --- Limelight/Network/AppListResponse.m | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Limelight/Network/AppListResponse.m b/Limelight/Network/AppListResponse.m index 71fda0f..1cc94b6 100644 --- a/Limelight/Network/AppListResponse.m +++ b/Limelight/Network/AppListResponse.m @@ -66,8 +66,8 @@ static const char* TAG_APP_IS_RUNNING = "IsRunning"; //Log(LOG_D, @"node: %s", node->name); if (!xmlStrcmp(node->name, (xmlChar*)TAG_APP)) { xmlNodePtr appInfoNode = node->xmlChildrenNode; - NSString* appName; - NSString* appId; + NSString* appName = @""; + NSString* appId = nil; BOOL appIsRunning = NO; while (appInfoNode != NULL) { if (!xmlStrcmp(appInfoNode->name, (xmlChar*)TAG_APP_TITLE)) { @@ -95,12 +95,12 @@ static const char* TAG_APP_IS_RUNNING = "IsRunning"; } appInfoNode = appInfoNode->next; } - App* app = [dataMan createApp]; - app.name = appName; - app.id = appId; - app.host = host; - app.isRunning = appIsRunning; - if (app.id != nil) { + if (appId != nil) { + App* app = [dataMan createApp]; + app.name = appName; + app.id = appId; + app.host = host; + app.isRunning = appIsRunning; [_appList addObject:app]; } }