don't add_ref if the revision doesn't exist

This commit is contained in:
krangelov
2021-09-28 11:12:12 +02:00
parent 9863f32d05
commit 67f83ebf8a

View File

@@ -638,8 +638,10 @@ PgfRevision pgf_checkout_revision(PgfDB *db, PgfText *name,
PGF_API_BEGIN {
DB_scope scope(db, WRITER_SCOPE);
ref<PgfPGF> pgf = PgfDB::get_revision(name);
Node<PgfPGF>::add_value_ref(pgf);
db->ref_count++;
if (pgf != 0) {
Node<PgfPGF>::add_value_ref(pgf);
db->ref_count++;
}
return pgf.as_object();
} PGF_API_END