Always verify that pointers and function return values are not null before dereferencing or using them. This prevents crashes and undefined behavior, especially when working with C functions or manual memory management.

Key practices:

Example from discussions:

// Bad: No null check for C function return
display := C.XOpenDisplay(0)
// Immediate use without verification

// Good: Check for null return
display := C.XOpenDisplay(0)
if display == unsafe { nil } {
    return error('Failed to open display')
}
defer { C.XCloseDisplay(display) }

This practice is essential for robust code that interfaces with C libraries or manages pointers manually.