---
title: "System.NullReferenceException"
type: "forum-thread"
url: "https://www.webforum.nu/amne/dotnet/135030-system-nullreferenceexception"
topic: ".NET"
topic_url: "https://www.webforum.nu/amne/dotnet"
author: "Travoni"
published: "2005-09-30T12:35:32.000Z"
updated: "2005-09-30T14:32:12.000Z"
replies: 3
views: 237
page: 1
pages: 1
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/dotnet/135030-system-nullreferenceexception"
---

# System.NullReferenceException

## #1 — Travoni, 2005-09-30T12:35Z

Jag fattar inte vad som är fel:

```
Application.Lock()
        [b]If InStr("~" & Application("active_users").ToString, "~" & username & "~") = 0 Then[/b]
            Application.Add("active_users", Application.Get("active_users").ToString & username & "~")
End If
```

Permalänk: https://www.webforum.nu/p/135030

## #2 — emission, 2005-09-30T13:11Z

Application("active_users") är inte initierat?

Permalänk: https://www.webforum.nu/p/1679867

## #3 — Travoni, 2005-09-30T13:50Z

Måste man det? I Global.asax?

Permalänk: https://www.webforum.nu/p/1679882

## #4 — emission, 2005-09-30T14:32Z

Ja, det är ett lämpligt ställe. Om inte Application("active_users") finns, så kommer anropet av ToString att rendera i en NullReferenceException .

Permalänk: https://www.webforum.nu/p/1679894

---

Tråden på webben: https://www.webforum.nu/amne/dotnet/135030-system-nullreferenceexception
