From 0eb07988730fc5cb475eb84c418f02e3b43b7afa Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Mon, 18 Feb 2013 12:24:49 +0000 Subject: fix errors introduced in refactor --- cocoa/BrowserViewController.m | 44 +++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'cocoa/BrowserViewController.m') diff --git a/cocoa/BrowserViewController.m b/cocoa/BrowserViewController.m index cd0f4bd12..75906fb22 100644 --- a/cocoa/BrowserViewController.m +++ b/cocoa/BrowserViewController.m @@ -67,22 +67,22 @@ - (IBAction) navigate: (id) sender; { - nsurl *unsrl; + nsurl *urlns; nserror error; - error = nsurl_create([url UTF8String], &url); + error = nsurl_create([url UTF8String], &urlns); if (error != NSERROR_OK) { warn_user(messages_get_errorcode(error), 0); } else { browser_window_navigate(browser, - nsurl, + urlns, NULL, BROWSER_WINDOW_HISTORY | BROWSER_WINDOW_VERIFIABLE, NULL, NULL, NULL); - nsurl_unref(url); + nsurl_unref(urlns); } } @@ -131,24 +131,24 @@ - (IBAction) goHome: (id) sender; { - nsurl *url; - nserror error; - - error = nsurl_create(nsoption_charp(homepage_url), &url); - if (error != NSERROR_OK) { - warn_user(messages_get_errorcode(error), 0); - } else { - browser_window_navigate(browser, - url, - NULL, - BROWSER_WINDOW_HISTORY | - BROWSER_WINDOW_VERIFIABLE, - NULL, - NULL, - NULL); - nsurl_unref(url); - } - + nsurl *urlns; + nserror error; + + error = nsurl_create(nsoption_charp(homepage_url), &urlns); + if (error == NSERROR_OK) { + error = browser_window_navigate(browser, + urlns, + NULL, + BROWSER_WINDOW_HISTORY | + BROWSER_WINDOW_VERIFIABLE, + NULL, + NULL, + NULL); + nsurl_unref(urlns); + } + if (error != NSERROR_OK) { + warn_user(messages_get_errorcode(error), 0); + } } - (IBAction) reloadPage: (id) sender; -- cgit v1.2.3