# nicklockwood/NullSafe

NullSafe is a simple category on NSNull that returns nil for unrecognised messages instead of throwing an exception

Repository: https://github.com/nicklockwood/NullSafe
Canonical: https://ross.abutalabs.com/products/nullsafe
Language: Objective-C
License: NOASSERTION
License Family: other
Last push: 2023-08-14T15:29:54+00:00

## Health v2 (maintenance only)
Score: 32/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 0, release rhythm 35, longevity 100
- inputs: {"age_days": 5005, "days_push": 1115, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases, no_license
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1938, forks 356 (observed 2026-08-28T04:05:57.202938+00:00)

## What it is
NullSafe is a small Objective-C category on NSNull that returns nil for unrecognized messages instead of throwing an exception. It prevents common crashes caused by unexpected null values in JSON or plist data.

## Use cases
- prevent crashes from null values in JSON responses
- make NSNull tolerate unrecognized method calls
- handle nulls in plist parsing safely
- avoid exceptions when network data contains null instead of arrays or strings

## When to choose
- you maintain a legacy Objective-C iOS or macOS app that crashes on unexpected JSON nulls
- you want a drop-in single-file fix with no header includes
- you need ARC and non-ARC compatibility

## When to avoid
- you are writing new code in Swift where optionals already handle nulls
- you prefer explicit null handling over runtime message interception
- your project targets modern platforms where NSNull misuse is rare

## Facets
- artifact type: library
- maturity: maintenance
- function: error-handling, serialization
- domain: developer-tools, mobile-development
- platform: -
- tags: objective-c, nsnull, crash-prevention, ios, macos

## Member repositories
- nicklockwood/NullSafe (main) score 32

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:57.202938+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T03:08:13.412852+00:00, confidence not recorded.
  - readme: https://github.com/nicklockwood/NullSafe (fetched 2026-08-28T04:05:57.202938+00:00, sha c7f5a8483f33)
- Data as of 2026-08-30T08:39:29.467469+00:00.
