databaseManager.saveData(record) saves all if no record

How does databaseManager.saveData( record ) handle saving, if there is no record (record is null or undefined)? I assumed, that if there is no record, no saving is needed.

In the Servoy Framework 4.0.0. in the function setUserProperty( propertyName, propertyValue, userId ) is at the end a databaseManager.saveData( record ) call, but the record is undefined and I realized that changes from other foundsets then also saved in the database, because of this call, which seems wrong to me.

I had to fix it.:

if ( record ) {
	databaseManager.saveData(record);
}

so that no other foundsets are saved by this call.

Is that a desired behaviour by databaseManager.saveData( record )?

I would assume, that databaseManager.saveData(record) and record is null, that it saves everything!
because databaseManager.saveData() (with no argument) does also save every ‘not saved’ change

I think Servoy does not make a difference between null or undefined.
So yes, if you want to make sure, the record is saved only, you have to check, if there is a record object.

Harjo:
I would assume, that databaseManager.saveData(record) and record is null, that it saves everything!
because databaseManager.saveData() (with no argument) does also save every ‘not saved’ change

Yes of course, makes absolutly sense. ;) This is something about programming languages, because if I write databaseManager.saveData( ) I mean something different than databaseManager.saveData( record ).

deezzub:
In the Servoy Framework 4.0.0. […]

What’s “Servoy Framework”?