Adding null and error checks. r=nelsonb git-svn-id: svn://10.0.0.236/branches/NSS_3_3_BRANCH@102840 18797224-902f-48f8-a5cc-f745e15eee43