Syphon / Processing

Syphon Implementation for Processing
Other
137 stars 33 forks source link

Prevents null-pointer exception if server is not yet initialised #33

Closed cansik closed 6 years ago

cansik commented 6 years ago

Prevents null-pointer exception if the server not yet has been initialised. This happens if the user try's to check if there are clients before sending out an image.

void sendImageIfNecessary(PImage img) {
    if(syphon.hasClients())
        syphon.sendImage(img);
}

In this example we check if syphon has clients connected, but because the sendImage command was never called, the server is not initialised.

vade commented 6 years ago

Hey this makes a ton of sense, thank you for the PR and the report. I dont see anything wrong with this, really appreciate it!