Added asserts to check for null pointers being passed in from JS.

This commit is contained in:
waterson%netscape.com 1999-04-07 00:13:08 +00:00
Родитель 41381a07dc
Коммит cee98def18
1 изменённых файлов: 12 добавлений и 0 удалений

Просмотреть файл

@ -483,6 +483,10 @@ nsBrowserAppCore::LoadUrl(const nsString& aUrl)
NS_IMETHODIMP
nsBrowserAppCore::SetToolbarWindow(nsIDOMWindow* aWin)
{
NS_PRECONDITION(aWin != nsnull, "null ptr");
if (! aWin)
return NS_ERROR_NULL_POINTER;
mToolbarWindow = aWin;
NS_ADDREF(aWin);
mToolbarScriptContext = GetScriptContext(aWin);
@ -493,6 +497,10 @@ nsBrowserAppCore::SetToolbarWindow(nsIDOMWindow* aWin)
NS_IMETHODIMP
nsBrowserAppCore::SetContentWindow(nsIDOMWindow* aWin)
{
NS_PRECONDITION(aWin != nsnull, "null ptr");
if (! aWin)
return NS_ERROR_NULL_POINTER;
mContentWindow = aWin;
NS_ADDREF(aWin);
@ -530,6 +538,10 @@ nsBrowserAppCore::SetContentWindow(nsIDOMWindow* aWin)
NS_IMETHODIMP
nsBrowserAppCore::SetWebShellWindow(nsIDOMWindow* aWin)
{
NS_PRECONDITION(aWin != nsnull, "null ptr");
if (! aWin)
return NS_ERROR_NULL_POINTER;
if (!mContentWindow) {
return NS_ERROR_FAILURE;
}